From 56df129e9de9022c2aa01717a784d94e1374115e Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 22 Mar 2021 23:11:46 +0300 Subject: code refactoring --- e3372-reboot.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'e3372-reboot.sh') diff --git a/e3372-reboot.sh b/e3372-reboot.sh index f727177..7b0e9e7 100755 --- a/e3372-reboot.sh +++ b/e3372-reboot.sh @@ -1,16 +1,12 @@ #!/bin/bash -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" . "$DIR/config.sh" -curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml -COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` -TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` +get_token curl -s -X POST "http://$MODEM_IP/api/device/control" \ - -H "Cookie: $COOKIE" \ - -H "__RequestVerificationToken: $TOKEN" \ - -H "Content-Type: text/xml" \ - -d "1" - -#test \ No newline at end of file + -H "Cookie: $COOKIE" \ + -H "__RequestVerificationToken: $TOKEN" \ + -H "Content-Type: text/xml" \ + -d "1" -- cgit v1.2.3