RaynoP
June 11, 2013, 11:07am
1
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
RaynoP
June 11, 2013, 5:38pm
2
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
welan
February 23, 2014, 6:26pm
3
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”;
}
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”
:put “xxx” do not pass a parameter to a function…
Good fortune.
ckgth
March 18, 2014, 7:35pm
7
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.
ckgth
March 18, 2014, 8:51pm
9
Hi,
you are right!
Many thanks.
but: manualy run the script from terminal is also not going. But with sheduler only, it works fine!