script to reboot a Mikrotik - how ? no longer rebooting ?
Would somebody please help me ?
I have a script that is called from netwatch when something no longer pings.
I have used this script for many years.
I just noticed that it is no longer working - (but it used to work on older versions of ROS)
I am currently running 6.37.1
My script contains the following (the script that used to work).
... some stuff in the script ...
:log info "-----> Rebooting in 15 seconds";
:delay 5;
/file print file=ScriptRebootReason
/file set ScriptRebootReason.txt contents="Rebooted by Toms script on $[/system clock get date] at $[/system clock get time]"
:log error "-----> Rebooting in 10 seconds";
:delay 5;
:log error "-----> Rebooting in 5 seconds";
:delay 5;
:log error "-----> Rebooting now";
:delay 1;
/system reboot
/system reboot
/system reboot
/system reboot
}
Note: the log error portion of the above script is working - I see the lines showing up in my log. However - the Mikrotik will not reboot.
Note: when I go CLI prompt (via telnet/ssh or the winbox-New-Terminal and I paste in
/system reboot
/system reboot
/system reboot
/system reboot
The Mikrotik will reboot.
However when this is in a script, The Mikrotik will not reboot.
Their appears to be nothing to support something like a " /system reboot -y " or a " /system reboot -noquery "
So - does anybody have a solution ?
Thank you
North Idaho Tom Jones