Created
September 16, 2020 01:49
-
-
Save milankragujevic/9cfc5825c6cbc20900b94f6a75bf81d3 to your computer and use it in GitHub Desktop.
Reboot ZTE MF283V from shell
This file contains 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
#!/usr/bin/expect | |
# to enable telnet, log in via web browser then run this command: | |
# curl "http://192.168.0.1/goform/goform_set_cmd_process" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Referer: http://192.168.0.1/index.html" --data "isTest=false&goformId=URL_FILTER_ADD&addURLFilter=http%3A%2F%2Ffakeurl%2F%26%26telnetd%26%26" | |
# the command is needed to be run only once! | |
# to disable telnet, factory reset the modem | |
set timeout 20 | |
set hostName "192.168.0.1" | |
set port "4719" | |
set userName "admin" | |
set password "admin" | |
spawn telnet $hostName $port | |
expect "ralink login:" | |
send "$userName\r" | |
expect "Password:" | |
send "$password\r"; | |
expect "# " | |
send "reboot\r" | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment