Community discussions

MikroTik App
 
GERRYNET
newbie
Topic Author
Posts: 25
Joined: Tue Mar 03, 2009 6:06 pm

Script to turn off and turn on the router automatically

Thu May 28, 2009 4:31 am

Hey Teachers:
someone can help me with a script to turn off the router, and will automatically switch on :?:

thanks
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26287
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Script to turn off and turn on the router automatically

Thu May 28, 2009 9:17 am

why would you ever turn off a router? sorry, but if the router is off, no scripts can be running :)
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Script to turn off and turn on the router automatically

Thu May 28, 2009 12:42 pm

but when you have WOL feature, you may use neighbour router to switch on your one =)
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26287
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Script to turn off and turn on the router automatically

Thu May 28, 2009 1:01 pm

no, WOL from router can turn on a PC. it's not meant for turning on Router.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Script to turn off and turn on the router automatically

Thu May 28, 2009 1:19 pm

but if router is on x86... =)
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26287
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Script to turn off and turn on the router automatically

Thu May 28, 2009 1:22 pm

I still think it's weird to keep the router powered off, and turn it on only sometimes :)
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

Re: Script to turn off and turn on the router automatically

Tue Jun 09, 2009 4:41 pm

well .... u can use any timer
 
rmichael
Forum Veteran
Forum Veteran
Posts: 718
Joined: Sun Mar 08, 2009 11:00 pm

Re: Script to turn off and turn on the router automatically

Wed Jun 10, 2009 12:40 am

 
stalinkov
just joined
Posts: 2
Joined: Mon Mar 04, 2019 6:02 pm

Re: Script to turn off and turn on the router automatically

Mon Aug 02, 2021 12:05 pm

Hi, I need a script to turn off the routerboard "anykind" when the voltage of the battery is below 10V and to switch power on when voltage is 11V.
This scenario is usefull for our stations that have only solar power, and we don't want to damage the battery, and we dont want to go to the station each time it is shutdown.
We don't want to use POE routerboard to turn on and off the port.
 
infabo
Long time Member
Long time Member
Posts: 585
Joined: Thu Nov 12, 2020 12:07 pm

Re: Script to turn off and turn on the router automatically

Mon Aug 02, 2021 1:22 pm

necro-jacking a topic from 2009 is not recommended.

What you need is not a script. Can routerboard read out voltage at all? But even then. Wrong place inside ROS.

You are talking about a low voltage cutoff.

something like https://m.banggood.com/YX-X0001-12V-Bat ... 44489.html
 
User avatar
MickeyT
Member Candidate
Member Candidate
Posts: 125
Joined: Tue Feb 18, 2020 7:06 am
Location: Australia

Re: Script to turn off and turn on the router automatically

Wed Aug 04, 2021 9:25 am

It sounds more like you want to use the UPS module in RouterOS (you need to install this separately) and have the router connected to a proper UPS. This will allow the router to do monitoring and hibernate when the runtime is too low and then turn back on when the power comes back.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Script to turn off and turn on the router automatically

Wed Aug 04, 2021 10:11 am

Why write this thing?
Once turned off you have to go and turn it on "manually",
there is nothing automatic in the RouterBOARD that, once turned off, makes it turn on again,
or must be find a UPS to which RouterOS can sends commands like "now turn me off and turn me back on when the power returns "

Who is online

Users browsing this forum: Google [Bot] and 17 guests