Update RouterOS Script
Here’s a script to update your software or firmware on your RouterOS device at a single click.
Run URS once to Update the Software , routerboard will then reboot once the software has been downloaded,once back up re run the script to update firmware.
/system script
add dont-require-permissions=no name=Updatefirm owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=”:lo\
cal ID ([/system identity get name])\r\
\n:local FIRMV ([/system routerboard get current-firmware])\r\
\n:local FIRMN ([/system routerboard get upgrade-firmware])\r\
\n:local DELAYS \”7s\”\r\
\n:if ([\$FIRMV] = \$FIRMN) do={\r\
\n:log error \”\$ID Firmware \$FIRMV is same as new \$FIRMN\” \r\
\n} else {\r\
\n:log error \”Current Firmware is \$FIRMV , Upgrading to \$FIRMN\”\r\
\n:local UF ([/system routerboard upgrade])\r\
\n:log error \”Upgrade in progress to \$FIRMN\”\r\
\n:delay \$DELAYS\r\
\n/system reboot\r\
\n}\r\
\n}”
add dont-require-permissions=no name=URS owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=”:lo\
cal ID ([/system identity get name])\r\
\n:local UC ([/system package update check-for-update])\r\
\n:local ROSO ([/system package update get installed-version])\r\
\n:local ROSN ([/system package update get latest-version])\r\
\n:local DELAY \”60s\”\r\
\n:local DELAYS \”7s\”\r\
\n:if ([\$ROSO] = \$ROSN) do={\r\
\n:log error \”\$ID Software \$ROSO is same as new \$ROSN\”\r\
\n/system script run \”Updatefirm\”\r\
\n} else {\r\
\n:local UD ([/system package update download])\r\
\n:log warning \”\$ID currently downloading \$ROSN old Software = \$ROSO \”\
\r\
\n:delay \$DELAY\r\
\n:log warning \”\$ID \$ROSN Download complete\”\r\
\n:delay \$DELAYS\r\
\n:log error \”\$ID will be rebooting for router upgrade to \$ROSN\”\r\
\n:delay \$DELAYS\r\
\n/system reboot\r\
\ny\r\
\n;\r\
\n}”
Leave a Reply
Want to join the discussion?Feel free to contribute!