Community discussions

MikroTik App
 
hngjared
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Thu Dec 01, 2011 8:36 pm
Location: NYC USA

Changing CPU in script after kernel failure.

Thu May 28, 2015 11:34 pm

I'm trying to run a script to properly set the CPU back to its proper setting after kernel failure.

I want to schedule this to run on startup but can't seem to get it to work. If I remove the "/system reboot;" string it works fine and all is well. It's almost as if the reboot happens and doesn't give it enough time to process the change. Any ideas?

Appreciate any help!

:global test 0
:global test1 400MHz
:global test2 600MHz
:set test ([/system routerboard settings get cpu-frequency])
:if ($test = $test1) do= {[/system routerboard setting set cpu-frequency=$test2] , [/system routerboard setting set silent-boot=yes] , [/system reboot;] }
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: Changing CPU in script after kernel failure.

Fri May 29, 2015 2:51 am

I've seen this happen before, and it's like the script executes before everything is started. Adding a short delay at the beginning of the script has worked for me in the past.
:delay 5s
 
hngjared
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Thu Dec 01, 2011 8:36 pm
Location: NYC USA

Re: Changing CPU in script after kernel failure.

Fri May 29, 2015 3:42 pm

For whatever reason it started working properly when I changed the order of the commands.

Once I set the silent reboot first and the CPU frequency second it worked fine.

I appreciate it.

Thanks!

Who is online

Users browsing this forum: Ahrefs [Bot], BenceLK, jaclaz and 58 guests