2ble auth
This commit is contained in:
parent
850413e229
commit
3d61960eab
|
@ -16,13 +16,9 @@
|
|||
# return false;
|
||||
#}
|
||||
#?>
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
if [[ -f $MY_PATH/.install/.GPATH ]]; then source $MY_PATH/.install/.GPATH; fi
|
||||
if [[ -f $MY_PATH/../.install/.GPATH ]]; then source $MY_PATH/../.install/.GPATH; fi
|
||||
|
||||
[[ -f /tmp/sms.commands ]] && echo "" > /tmp/sms.commands
|
||||
tail -fn 1 /tmp/sms.commands | while read -r line
|
||||
do
|
||||
[[ $line != "" ]] && mycmd="$GPATH/shell/sms_AUTH.sh $line" && echo "RUN: $mycmd" && eval "$mycmd"
|
||||
[[ $line != "" ]] && mycmd="/home/pi/G1sms+/shell/sms_AUTH.sh $line" && echo "RUN: $mycmd" && eval "$mycmd"
|
||||
done
|
||||
|
|
|
@ -42,7 +42,7 @@ TIMEBEFORE=$(date --date="-$EVERY minutes" +"%s")
|
|||
[[ $NODE_G1PUBKEY == "" ]] && NODE_G1PUBKEY="5sdcypPRDrzEirtTqXwzvNnMwGpjXK6EhNdti8qsdS4h"
|
||||
TIMESTAMP=$(date +"%s")
|
||||
#log "GETTING last $EVERY mn TX : https://duniter-g1.p2p.legal/tx/history/$NODE_G1PUBKEY/times/$TIMEBEFORE/$TIMESTAMP"
|
||||
curl -s https://duniter-g1.p2p.legal/tx/history/$NODE_G1PUBKEY/times/$TIMEBEFORE/$TIMESTAMP | jq '.history.pending' | jq '.[].comment' > /tmp/scan.json
|
||||
curl -s https://duniter-g1.p2p.legal/tx/history/$NODE_G1PUBKEY/times/$TIMEBEFORE/$TIMESTAMP | jq '.history.pending' | jq '.[].comment' > /tmp/zenfontain.g1tx.txt
|
||||
while read SMS_1_TEXT
|
||||
do
|
||||
export $SMS_1_TEXT
|
||||
|
@ -55,7 +55,7 @@ do
|
|||
# TODO: EXTRACT CMD FROM TX AND RELAY TO SMS_RECEIVED API
|
||||
# TODO: MEMORIZE CMD TO MAKE IT ONLY ONE TIME!!!!!!!
|
||||
|
||||
done < /tmp/scan.json
|
||||
done < /tmp/zenfontain.g1tx.txt
|
||||
|
||||
# CHECK FOR EMAIL COMMAND
|
||||
FROM="None"
|
||||
|
|
|
@ -36,7 +36,9 @@ SMSPIN=$((1000 + RANDOM % 9999))
|
|||
log "__SUB:sms_AUTH.sh: CODE $SMSPIN : $VIR < $MIN ? $testmin"
|
||||
if [[ "$testmin" -eq "1" ]]
|
||||
then
|
||||
mess="CODE: $SMSPIN"
|
||||
mess="CODE: $SMSPIN
|
||||
A saisir pour vous authentifier...
|
||||
[G1] Zen Astroport Satellite #$(cat /etc/hostname)"
|
||||
# Send response SMS
|
||||
sms_SEND "$PHONE" "$mess"
|
||||
echo $SMSPIN > /tmp/$PHONE.PIN.auth
|
||||
|
|
Loading…
Reference in New Issue