I was forced to repeatedly restart the device via telnet. But Telnet client not support reading commands from config file. Hm …
The solution is easy. Telnet Scripting Tool – by Albert Yale (Freeware).
Usage is also simply.
===============
Usage Syntax:
tst10.exe /r:script.txt [options]
/r:script.txt run script.txt
[options] any of these:
/o:output.txt send session output to output.txt
/m run script in minimized window
Usage Example:
tst10.exe /r:script.txt /o:output.txt /m
Scripting Syntax:
HOSTNAME PORT port number optional, default: 23
WAIT “string” string to wait for
SEND “string” string to send
\” represents the a quote character
\m represents a <CR/LF>
\\ represents the backslash character
Scripting Example:
hostname.com 23
WAIT “login”
SEND “root\m”
WAIT “password”
SEND “mypassword\m”
WAIT “>”
SEND “dip internet.dip\m”
WAIT “>”
=============
In my case:
192.168.1.245
WAIT “Password”
SEND “MyPassword\m”
WAIT “>”
SEND “sys reboot\m”