From 35b0936813c5ba5d4c4f76ef4dee97c68c636ba3 Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 18 Jun 2021 13:48:12 +0200 Subject: [PATCH] commentary --- almost_oneliners/huawei_restart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/almost_oneliners/huawei_restart b/almost_oneliners/huawei_restart index 16b185b..5965e6c 100644 --- a/almost_oneliners/huawei_restart +++ b/almost_oneliners/huawei_restart @@ -3,12 +3,15 @@ # if their connection has dropped. this one simply reboots the stick via api. # Api Documentation: https://blog.hqcodeshop.fi/archives/259-Huawei-E5186-AJAX-API.html +# edit as needed AUTH_URL="http://192.168.8.1/api/webserver/SesTokInfo" +# get respone and token from device curl -s $AUTH_URL > /tmp/huawei_token RESPONSE=`grep -oP "(.*)" temp.txt | cut -d ">" -f 2 | cut -d "<" -f 1` TOKEN=`grep -oP "(.*)" temp.txt | cut -d ">" -f 2 | cut -d "<" -f 1` #echo $RESPONSE +# trigger reboot curl -X POST http://192.168.8.1/api/device/control -H "Cookie: $RESPONSE" -H "__RequestVerificationToken: $TOKEN" --data "1"