/system reboot
Doesn't it still need the yes or no answered?Put it in a script.
Tested on RB532 and RB433Code: Select all/system reboot
#!/usr/bin/perl
use Net::Telnet;#poziva se Telnet modul
#Inicijalizacija username-a i passworda
$username = 'admin';
$pass = 'password';
$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die');
$telnet->open('some ip');
$telnet->login($username, $pass);
$telnet->cmd('/system reboot' + <CR><LF> + 'y');
[root@localhost omer]# ./reboot.pl
syntax error at ./reboot.pl line 12, near "LF>"
Execution of ./reboot.pl aborted due to compilation errors.
$telnet->cmd("/system reboot\ny");
No of course not.Doesn't it still need the yes or no answered?Put it in a script.
Tested on RB532 and RB433Code: Select all/system reboot
name="reboot" owner="hilton"
policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive
run-count=0 source=
:delay 10s
/system reboot
/system scheduler
add comment="" disabled=yes interval=1s name=schedule1 on-event=\
"/system scheduler disable schedule1 ;\r\
\n/system reboot;" policy=\
reboot,read,write,policy,test,password,sniff,sensitive start-date=\
jan/01/1970 start-time=00:00:00
/system scheduler enable schedule1
/system reboot;
/system reboot confirmation=no
#!/usr/bin/perl
use strict;
use Net::Telnet;
my $host = "192.168.88.1";
my $login = "admin";
my $passwd = "";
my $t = new Net::Telnet (Timeout => 30, Prompt => '/\] > $/' );
$t->open( $host );
$t->login( $login, $passwd );
$t->cmd('
/system reboot;
y');
$t->close();
exit
/system scheduler add name=reboot on-event="/system reboot" start-time=([/system clock get time] + 00:00:10)
$ echo '/system/reboot^My' | ssh mtrouter
Code: Select all$ echo '/system/reboot^My' | ssh mtrouter
echo -e '/system/reboot\ny' | ssh mtrouter
This thread is missing a question.Is it possible to force reboot on RouterOS?
/system scheduler
add name="scheduled reboot" on-event="/system reboot" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=nov/19/2021 start-time=03:03:03
That is why I ask why he need to reboot, to adopt the answer to what the need is. Not guess it just for fun.The OP never claimed that it is done to solve a problem.
:execute {/system reboot}
Thank you! Working on 7.8You can even remove the not needed semi column.
Works on latest 7.2rc3 as wellCode: Select all:execute {/system reboot}
I came here googling for a solution to reboot without confirmation. Thanks mict!!!try with :execute {/system reboot;}