Upgrade Script not running

Hi There,

When I create and run this script the upgrade part works but the reboot does not.

/system script
add name=script1 policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source=“/system routerboard upgrade\r\n/system reboot\r\n”

I have to create 2 separate scripts to get the job done ?

Have tried all sorts of “;” delay 1’s combination etc

Any ideas ?

Cheers

For anyone who is interested I got it to work this way.

/system script add name=“upgrade” source=“/system routerboard upgrade”
/system script run upgrade
/system reboot

wo_Ot

why not just

/system routerboard upgrade
/system reboot

?..

Tried that but it just did not seem to work in fact thats what I tried the very first time.
The system routerboard upgrade command ran but the reboot did not happen.

but you still do reboot manually - what has been changed?.. %)

I should mention that I am running these commands via ssh remotely, not via local terminal.

hmmm… are you waiting for reply, or simply send both commands?..

Just sending both commands

maybe that’s the problem…

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

What permissions are necessary in order to schedule and execute this kind of task?

try yourself,
remove all and add one by one until you do not find the right combo...

/system;routerboard upgrade;reboot


And in any case, the system can update itself...
Just do a normal reboot, without any other prerogatives.
/system routerboard settings set auto-upgrade=yes

1 Like

So just the "reboot" policy is needed?