Community discussions

 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1264
Joined: Sun Sep 18, 2011 7:00 pm

how to make the unit reboot in script?

Thu Aug 04, 2016 3:38 pm

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,
 
User avatar
BlackVS
Member Candidate
Member Candidate
Posts: 171
Joined: Mon Feb 04, 2013 7:00 pm
Contact:

Re: how to make the unit reboot in script?

Thu Aug 04, 2016 9:00 pm

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...
 
scampbell
Trainer
Trainer
Posts: 457
Joined: Thu Jun 22, 2006 5:20 am
Location: Wellington, NZ
Contact:

Re: how to make the unit reboot in script?

Fri Aug 05, 2016 2:17 am

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.
MTCNA, MTCWE, MTCRE, MTCTCE, MTCSE, MTCINE, Trainer
___________________
Mikrotik Distributor - New Zealand
http://www.campbell.co.nz
 
cutedrummerboy
Member Candidate
Member Candidate
Posts: 137
Joined: Thu Nov 14, 2013 6:32 pm

Re: how to make the unit reboot in script?

Fri Aug 05, 2016 5:41 pm

yeah if you write a script with only /system reboot and run it it will reboot the router.
Device: RB2011UIAS-RM, RB750GL, CISCO SG300-28, UNIFI UAP-LR

Who is online

Users browsing this forum: No registered users and 72 guests