Skip to content

Instantly share code, notes, and snippets.

@milankragujevic
Created September 16, 2020 01:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milankragujevic/9cfc5825c6cbc20900b94f6a75bf81d3 to your computer and use it in GitHub Desktop.
Save milankragujevic/9cfc5825c6cbc20900b94f6a75bf81d3 to your computer and use it in GitHub Desktop.
Reboot ZTE MF283V from shell
#!/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