I’m looking for a script that will check our main ROS box for updates and install them if it finds any. None of the scripts in the Wiki work correctly.
You could do this through scripting(php, perl, etc) but I wouldn’t recommend this. IMO it’s better to have a person do the upgrade in case something goes wrong so they can react quickly and accordingly to try to resolve the issue.
- If I wanted to do this I’d use a library that’d login using either SSH or the API(only available on 3.x firmware) and check what firmware is currently installed, if the firmware wasn’t the most current it’d go to step 2.
- Have the FTP service enabled but restricted by IP address. Pull the currently installed packages through SSH or the API then upload the new packages by FTP but with a different extension, like .new
- After uploading the files, have the script send an email to yourself letting you know there is an update ready to be installed. I’d make it easy on myself and include a link in the email, something along the lines of “process_update.php?ip_address=10.10.10.10” 10.10.10.10 would be the ip address of the device the new packages were just uploaded to. That script would also be restricted by ip address so malicious users couldn’t use it. Once you click the link, it’d login to the router and rename the files from .new back to .npk; after renaming the files it’d send “system reboot” to the router and start a ping to the address and notify you once there was a response, when it starts to receive a response and can login it’d check if the update was installed, if it was it’d let you know then it would issue a “system routerboard upgrade” if needed and would take the appropriate actions after that.
I realize telling you this may not be what you’re looking for but I thought I should express my concern and my opinion on a better way to go about handling this.
If I had more time on my hands this is how I would implement the solution.
how about this:
http://www.mikrotik.com/testdocs/ros/2.9/system/upgrade.php
or using the Dude for central upgrade management (Dude has this ability)
Has anyone gotten the above to work on mips or powerpc MT hardware? We used to use this with success in 2.9.x but haven’t seen it work on 3.x yet. I have tried it on 3.9, 3.10, 3.11, and 3.12 with hardware from an rb333, rb4xx, rb532, rb600, and rb1000 without success.
As soon as I run refresh from either the GUI, the router becomes unresponsive and within a few seconds, disconnects me. I see the router’s CPU bouncing from normal load to 100%, then I get disconnected. The router does not reboot and auto supouts are not generated.
From the terminal with SSH, when I run / system upgrade refresh It immediately returns to the command line, but no packages show up with a / system upgrade print. So the question is; has anyone used this utility successfully in 3.x and if so on what hardware?
How about using fetch to get the update file on the router ? The inconvenient would be that you have to know the name of the file…
I use this on my client devices.
Make sure upgrade-package-source is configured.
Make sure NTP client is configured.
Make sure the new files are where they should be.
You can change the interval to whatever you want. I set mine to check every 30 days.
If an upgrade comes out that I want to install, I copy it to the upgrade server.
/system scheduler add name=sched_upgrade on-event=upgrade start-date=Oct/09/2008 start-time=02:40:00 interval=30d
/system script add name=upgrade source=“/system upgrade refresh\r\n:delay 05\r\n/system upgrade download-all reboot-after-download=yes”
???Firmware upgrade is another story…Need a script to check installed fw version against upgrade version, If upgrade version is newer, then install it. I’m sure it can be done. I’m no guru…yet, but the information is there. Just need to configure the scripts to read it, interpret it and execute the appropriate commands.
I’ve been mac telnet’ing from the AP to clients and pasting these commands.
system routerboard upgrade
y
system reboot
y