Community discussions

MikroTik App
 
User avatar
amt
Long time Member
Long time Member
Topic Author
Posts: 529
Joined: Fri Jan 16, 2015 2:05 pm

reboot device over ssh

Tue May 23, 2017 8:55 am

Hi,
I try to reboot device over ssh with
/system reboot
or
/system reboot;
but when i execute this code manually it asks for confirmation. how can I auto input Y so that i dont have to press key manually?
any solution?

Thanks
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: reboot device over ssh

Tue May 23, 2017 10:26 am

Try forum search on system reboot confirmation.

viewtopic.php?f=2&t=35635&p=589156#p589156
I think, the best way to force reboot (until there is no support for confirmation=no switch) is to create one-time scheduler, which starts 10s after creation and calls /system reboot command (no confirmation required then):
/system scheduler add name=reboot on-event="/system reboot" start-time=([/system clock get time] + 00:00:10)
Tested on v6.34.2.
Just tested this on 6.40rc6 and it works fine.
 
User avatar
amt
Long time Member
Long time Member
Topic Author
Posts: 529
Joined: Fri Jan 16, 2015 2:05 pm

Re: reboot device over ssh

Tue May 23, 2017 11:45 am

Try forum search on system reboot confirmation.

viewtopic.php?f=2&t=35635&p=589156#p589156
I think, the best way to force reboot (until there is no support for confirmation=no switch) is to create one-time scheduler, which starts 10s after creation and calls /system reboot command (no confirmation required then):
/system scheduler add name=reboot on-event="/system reboot" start-time=([/system clock get time] + 00:00:10)
Tested on v6.34.2.
Just tested this on 6.40rc6 and it works fine.
Hi,
I found the soultion.. Thanks
 
FunctionalIT
just joined
Posts: 6
Joined: Fri Oct 21, 2016 10:45 am

Re: reboot device over ssh

Fri Nov 19, 2021 12:31 pm

And the solution is?

The scheduler is an option. Did you find something else?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: reboot device over ssh

Fri Nov 19, 2021 6:08 pm

Is too hard follow and read already posted link and solution?
:execute {/system reboot}

Who is online

Users browsing this forum: Amazon [Bot], anav, Bing [Bot], kub1x, tuckerdog, VinceKalloe and 83 guests