Community discussions

 
kgninfos
Member
Member
Topic Author
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Auto upgrade script

Fri May 15, 2015 8:28 pm

Hello
i was looking for some CPE auto upgrade script and have found a few in wiki but none of them fits perfect for my situation

actually the problem is users here are bit illiterate so if internet is not working they switch off cpe which might brick the cpe
what i wanted is an upgrade script that will download the files form my local server as soon as i upload them
then do a RoS + firmware upgrade then download a script file form server and run it (will use this to write new configs to cpe at once)

can any one help me in this

Thanks
 
User avatar
Bigfoot
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Sat Jan 15, 2011 10:41 am
Location: South Africa

Re: Auto upgrade script

Mon May 18, 2015 7:55 pm

You can try this
Create a small ftp server, create a share folder "/routeros/6.28/" depending on the versions you what to upgrade. Extract all the package to the folder "D:/routeros/6.28/"

On the RB that you want to upgrade do the following:
/ip dns static
add address= "Your ftp server ip" name=upgrade.mikrotik.com

/system package update
check-for-updates
:delay 1s;
:if ( [get current-version] != [get latest-version]) do={ /system package update upgrade };

Reboot RB.
 
kgninfos
Member
Member
Topic Author
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: Auto upgrade script

Fri May 22, 2015 10:52 pm

can it be like it should auto reboot and during upgrade it should check the files cor corruption like if power fails while it's rebooting or half the files downloaded then what will happen ??
 
kgninfos
Member
Member
Topic Author
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: Auto upgrade script

Tue Jul 21, 2015 6:37 pm

Hello
i want some thing like this
http://wiki.mikrotik.com/wiki/Semi-Auto ... ng_changes

but i want this to be a single step thing like i upload the files to my ftp server and it should download the packages (should download all files in the directory then reboot if any file is not downloaded then upon reboot it should not upgrade to avoid any compatibility problem)

then upon reboot firmware should be upgraded

and most important thing if cpe version is already latest it should not again download the updates
 
User avatar
Hrobocop
just joined
Posts: 18
Joined: Sun Dec 04, 2011 12:07 pm
Location: Prague

Re: Auto upgrade script

Wed Dec 09, 2015 4:09 pm

My updated auto-upgrade script is here: https://github.com/massimo-filippi/mikrotik
Fully working on 6.33.3
 
User avatar
shodan
newbie
Posts: 29
Joined: Sun Dec 01, 2013 3:26 pm
Location: Tula, Russia
Contact:

Re: Auto upgrade script

Mon Dec 14, 2015 8:18 pm

Hi Hrobocop, i recomend in your auto-update script add delay between load new firmware and reboot.
Like this:
   :log info ("Downloading new RouterOS on router $[/system identity get name] from $[/system package update get installed-version] to $[/system package update get latest-version] (channel:$[/system package update get channel])")     

   ## Wait for mail to be send & download FW
   :delay 15s;

   download

    ## Wait for upgrade all mikrotik in network, then reboot
   :delay 300s;

   :log info ("Upgrading RouterOS on router.")     

   /system reboot
In my net i have many Mikrotik devices, when it "all" start update at same time, on some one devices downloading has fail, because uplink(up Mikrotik) has rebooted first.

Also i add to begin
/system backup save name=disk1/before_firmware_update
Because some times Mikrotik has died on update.
I use right now:
-=CCR1009+8G-1S-1S+RM=- -=CRS226-24G-2S+RM=- -=DXS-1210-12SC=- for little home network.
We... Russian "crazy" sysadmins, loving much CPU power and throughput in reserve.
По русски говоря: Задрот по микротику :)
 
Zero3K
just joined
Posts: 17
Joined: Sat Apr 22, 2017 11:25 pm
Location: Louisville, KY, USA

Re: Auto upgrade script

Sat Apr 29, 2017 7:02 pm

My updated auto-upgrade script is here: https://github.com/massimo-filippi/mikrotik
Fully working on 6.33.3
It would be nice if it also checked for an updated version that is a part of the release_candidate channel and upgraded to that one if so.
 
gledishia
just joined
Posts: 1
Joined: Wed Dec 05, 2018 12:22 pm

Re: Auto upgrade script

Wed Dec 05, 2018 12:41 pm

You can try this
Create a small ftp server, create a share folder "/routeros/6.28/" depending on the versions you what to upgrade. Extract all the package to the folder "D:/routeros/6.28/"

On the RB that you want to upgrade do the following:
/ip dns static
add address= "Your ftp server ip" name=upgrade.mikrotik.com

/system package update
check-for-updates
:delay 1s;
:if ( [get current-version] != [get latest-version]) do={ /system package update upgrade };

Reboot RB.
----------------
Hi
is there a way to manualy upgrade my first router and use a script on this router to distribute and run these upgrades offline to other routers im my network(lan) ?
may be with their Mac address or IPs.
 
User avatar
eworm
Member Candidate
Member Candidate
Posts: 184
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Auto upgrade script

Wed Dec 12, 2018 11:14 pm

The script that I use is this one:
check-routeros-update on github or cgit

Its primary purpose is to notify me about updates, but now that fetch command can put results in variable (Thanks Mikrotik!) I added an auto-upgrade functionality. Only thing required is a http server to give the version.

(This depends on other scripts in the repository, see README for setup.)
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
strods
MikroTik Support
MikroTik Support
Posts: 1367
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: Auto upgrade script

Wed Dec 12, 2018 11:52 pm

What about built-in RouterOS local upgrade server? It is described below auto upgrade scripts: Look for "RouterOS can download software packages from a remote MikroTik router".

https://wiki.mikrotik.com/wiki/Manual:U ... g_RouterOS
 
sid5632
Member Candidate
Member Candidate
Posts: 277
Joined: Fri Feb 17, 2017 6:05 pm

Re: Auto upgrade script

Thu Dec 13, 2018 2:48 am

Some of the Dude stuff on that page is well out of date...

Who is online

Users browsing this forum: No registered users and 11 guests