diff --git a/shell/0.sms.command.sh b/shell/0.sms.command.sh index 90534ac..383d1cc 100755 --- a/shell/0.sms.command.sh +++ b/shell/0.sms.command.sh @@ -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 diff --git a/shell/cron_MINUTE.sh b/shell/cron_MINUTE.sh index a07be58..8c2b564 100755 --- a/shell/cron_MINUTE.sh +++ b/shell/cron_MINUTE.sh @@ -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" diff --git a/shell/sms_AUTH.sh b/shell/sms_AUTH.sh index c04b4d7..5e0bb21 100755 --- a/shell/sms_AUTH.sh +++ b/shell/sms_AUTH.sh @@ -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