Hello all!
I tied to run command in scipt (ver 4.xx) but nothing work! I think that command /system routerboard upgrade prompt “Yes” to accept, but in script this command not working.
# Check bios firmware
:if ( [/system routerboard get current-firmware] != [/system routerboard get upgrade-firmware] ) do={
:log error "Bios firmware different! Need upgrade"
/system routerboard upgrade
:delay 10
/system reboot
}
please, tell me where i am wrong?
Try this, worked for me when I had the same problem:
/system script
add name="Upgrade bootloader" source="/system routerboard upgrade"
and in your original script, subtitute
/system routerboard upgrade
with
/system script run "Upgrade bootloader"
it was the only way I could get it to work, on 3.29+ and some early 4.x, haven’t tried since.
ManyX
July 9, 2012, 3:05pm
3
Hello
Whay script stop after /system routerboard upgrade;
Look
:if ([/system routerboard get current-firmware] != [/system routerboard get upgrade-firmware]) do={
:log error "Bios need upgrade";
/system routerboard upgrade;
:delay 10;
:log error "reboot";
/system reboot} else={:log warning "Nothing"}
:log error "END"
I cant see no log after command /system routerboard upgrade
I need script to upgrade about 1000 CPE by automat
Every CPE have scheduler that download once a day script to run from FTP server
Regards.
BD
ManyX
July 9, 2012, 10:37pm
4
This solution works for me. It may be useful to someone
You may import this script from scheduler
/import upgrade-fw.rsc
upgrade-fw.rsc
:if ([/system routerboard get current-firmware] != [/system routerboard get upgrade-firmware]) do={
:log error "Bios need upgrade";
/system script add name="upgrade" source="/system routerboard upgrade";
/system script run upgrade;
:delay 5;
/system script remove [find name=upgrade];
:delay 5;
/system reboot} else={:log warning "Nothing"}
regards.
BD
dash
August 25, 2017, 12:53pm
5
Hi guys,
“/system routerboard upgrade” requires a user input. When you execute the command in the terminal you need to confirm it with yes or no. It is the very same when you are trying to reboot the router from the terminal window with “/system reboot”.
As ManyX mentioned you can get rid of that if you run the scripts from the scheduler. In this case the additional confirmation would not be required.
Regards
strods
August 28, 2017, 1:46pm
6
You simply need to use this:
:execute script=“/system routerboard upgrade”
:execute script=“/system reboot”
https://wiki.mikrotik.com/wiki/Manual:Scripting#Global_commands
jspool
September 27, 2017, 2:27am
7
@strods So to be clear the second execute command will not run until the first has completed?