This commit is contained in:
Beu 2017-11-23 22:51:49 +01:00
parent a7ef429fe0
commit e2a8b0ac1e

View File

@ -9,7 +9,7 @@ OTP=`oathtool -w 4 --now="$DATE" --totp -b $SECRETKEY`
OTPFROMCLIENT=`echo $SMS_1_TEXT | awk '{print $NF}'`
CMD=`echo $SMS_1_TEXT | awk '{print tolower($1)}'`
TEXT=`echo $SMS_1_TEXT | awk '{for (i=2; i<NF; i++) print $i}'`
TEXT=`echo $SMS_1_TEXT | awk 'BEGIN {ORS=" "} {for (i=2; i<NF; i++) print $i}'`
MATCH=`echo $OTP | grep $OTPFROMCLIENT`
if [[ $SMS_1_NUMBER -eq $PHONENUM ]]; then
@ -27,11 +27,11 @@ if [[ $SMS_1_NUMBER -eq $PHONENUM ]]; then
;;
cmd)
HOST=`echo $TEXT | awk '{print $1}'`
COMMAND=`echo $TEXT | awk 'BEGIN {ORS=" "} {for (i=2; i<NF; i++) print $i}'`
COMMAND=`echo $TEXT | awk 'BEGIN {ORS=" "} {for (i=2; i<=NF; i++) print $i}'`
REPLY=`ssh -oStrictHostKeyChecking=no root@$HOST $COMMAND`
pxy)
PHONENUM=`echo $TEXT | awk '{print $1}'`
REPLY=`echo $TEXT | awk 'BEGIN {ORS=" "} {for (i=2; i<NF; i++) print $i}'`
REPLY=`echo $TEXT | awk 'BEGIN {ORS=" "} {for (i=2; i<=NF; i++) print $i}'`
;;
*)
REPLY="Commande inconnu"