Page 1 of 1

Upgrade Firmware via script with no user intervention

Posted: Tue Jun 11, 2013 2:07 pm
by RaynoP
Hi,

This question probably was asked and answered many times before:
How do I upgrade a routers firmware and restart it without pressing Y in the terminal?

I found another thread that showed how to dynamically import the rsc file but it does not seem to work perfectly. It still requires user input.

I have a couple of routers I need to upgrade ROS from a webserver which is not connected to the internet and want to automate the process.

I tried the normal script command:
/system routerboard upgrade
RaynoP

Re: Upgrade Firmware via script with no user intervention

Posted: Tue Jun 11, 2013 8:38 pm
by RaynoP
It seems like future version will have the feature as per response from support:
I'm sorry, I have checked with firmware update, currently it seems there is software issue, that is going to be fixed in the upcoming versions.


RaynoP

Re: Upgrade Firmware via script with no user intervention

Posted: Sun Feb 23, 2014 8:26 pm
by welan
Hi, I'm looking to make the same script, this is the code, what was wrong?

:global oldfirm [/system routerboard get current-firmware];
:global newfirm [/system routerboard get upgrade-firmware];
:if ([$oldfirm]<[$newfirm]) do={
/system routerboard upgrade;
:put "\r";
:delay 1s;
:put "y";
/system reboot;
:put "y";
}

Re: Upgrade Firmware via script with no user intervention

Posted: Sat Mar 15, 2014 11:23 pm
by RGuilhas
Try This worked for me

/system script
add name=firmware policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
source="\r\
\n:delay 30\r\
\n:global oldfirm [/system routerboard get current-firmware];\r\
\n:global newfirm [/system routerboard get upgrade-firmware];\r\
\n:if ([\$oldfirm]<[\$newfirm]) do={\r\
\n/system routerboard upgrade}\r\
\n:put \"y\"\r\
\n:delay 60\r\
\n:if ([\$oldfirm]<[\$newfirm]) do={/system reboot}\r\
\n:put \"y\"\r\
\n\r\
\n"

Re: Upgrade Firmware via script with no user intervention

Posted: Sun Mar 16, 2014 12:14 am
by rextended
:put y???

:put /r???


It's a Joke?

Re: Upgrade Firmware via script with no user intervention

Posted: Sun Mar 16, 2014 12:22 am
by rextended
:put "xxx" do not pass a parameter to a function...

Good fortune.

Re: Upgrade Firmware via script with no user intervention

Posted: Tue Mar 18, 2014 9:35 pm
by ckgth
Hi,

no. When i use you code, then the router will request for an "y(es)" ?!

regards
Christian

Re: Upgrade Firmware via script with no user intervention

Posted: Tue Mar 18, 2014 10:27 pm
by rextended
Hi,

no. When i use you code, then the router will request for an "y(es)" ?!

regards
Christian
Only if you manually paste on terminal.
You must put inside a script called by scheduler.

Re: Upgrade Firmware via script with no user intervention

Posted: Tue Mar 18, 2014 10:51 pm
by ckgth
Hi,

you are right!
Many thanks.

but: manualy run the script from terminal is also not going. But with sheduler only, it works fine!