Page 1 of 1

how to make the unit reboot in script?

Posted: Thu Aug 04, 2016 3:38 pm
by David1234
Hello ,
I'm want to write a script that in the end of it - will reset the unit
but it doesn't do it

when I run the script in the terminal , everything is working until this part:
are you sure (y\n)?

how do I tell him to ignore this and reset the unit anyway ?

the script end with
/system reboot;


Thanks,

Re: how to make the unit reboot in script?

Posted: Thu Aug 04, 2016 9:00 pm
by BlackVS
If I remember right it won't ask anything if run in script.
I've just tested - created simple script with one line "/system reboot;" and run it from Scripts List -> Scripts window - router rebooted.
I.e. "Y/n" is asked only when running from terminal...

Re: how to make the unit reboot in script?

Posted: Fri Aug 05, 2016 2:17 am
by scampbell
I concur with BlackVS.

We often create a scheduler to reboot router at midnight with just "/system reboot" as the only command - it works well and is only "interactive" when run from a console.

Re: how to make the unit reboot in script?

Posted: Fri Aug 05, 2016 5:41 pm
by cutedrummerboy
yeah if you write a script with only /system reboot and run it it will reboot the router.