Expect script equivalent on RouterOS
Posted: Thu Jun 27, 2013 3:01 pm
Hi all,
Is anyone aware of an equivalent to the linux expect command that can be used from routerOS?
What I am trying to achieve is to be able to use a script on an RB750 to monitor reachability to the internet, then if it detects an issue it automatically logs onto my aDSL router and issues the reboot command.
The problem is that the aDSL router only support telnet, so the script will have to issue a series of commands such as:
telnet 1.2.3.4 (This would connect to the device)
thedevicepassword (When promepted for the password it would send this Or just send it anyway after a few seconds)
set reboot (When it receives the command prompt from the device send the reboot command. Or just send it after a few seconds)
In Unix you would use the expect command to achieve this, I am struggling to script this in routerOS.
Can anyone be so kind as to help?
Thanks in advance.
Is anyone aware of an equivalent to the linux expect command that can be used from routerOS?
What I am trying to achieve is to be able to use a script on an RB750 to monitor reachability to the internet, then if it detects an issue it automatically logs onto my aDSL router and issues the reboot command.
The problem is that the aDSL router only support telnet, so the script will have to issue a series of commands such as:
telnet 1.2.3.4 (This would connect to the device)
thedevicepassword (When promepted for the password it would send this Or just send it anyway after a few seconds)
set reboot (When it receives the command prompt from the device send the reboot command. Or just send it after a few seconds)
In Unix you would use the expect command to achieve this, I am struggling to script this in routerOS.
Can anyone be so kind as to help?
Thanks in advance.