Created
November 16, 2018 21:43
-
-
Save BKirev/5210cf0cd5dd6c05e6e4bf898f6488cd to your computer and use it in GitHub Desktop.
Batch script for Huawei E3372H reboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set AUTH_URL="http://192.168.8.1/api/webserver/SesTokInfo" | |
curl %AUTH_URL% > temp.txt | |
set /p $RESPONSE = < temp.txt | |
for /f "tokens=2 delims=^<^>" %%a in (temp.txt) do ( | |
set "$session_id=%%a" | |
goto:next) | |
:next | |
for /f "skip=3 tokens=2 delims=^<^>" %%a in (temp.txt) do ( | |
set "$token=%%a" | |
goto:end) | |
:end | |
curl -X POST http://192.168.8.1/api/device/control -H "Cookie: %$session_id%" -H "__RequestVerificationToken: %$token%" --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?><request><Control>1</Control></request>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment