Community discussions

MikroTik App
 
jondavy
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Tue May 12, 2009 11:14 pm
Location: Brasil

Feature Request [Batch Update/ Batch Script]

Tue Mar 27, 2018 12:44 am

seeing the vulnerabilities found in RouterOS and the number of devices in our networks, I can not find ways to update everything automatically, it would be great an emergency solution to update the packages, routerboot and also block some services, but for this we need Dude do it! .
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Feature Request [Batch Update/ Batch Script]

Tue Mar 27, 2018 12:48 am

I'm using this script, may help you
# Firmware Update
###
:do {
:local Arch [/system resource get value-name=architecture-name];
:local Cver [/system resource get value-name=version];
:local Aver "6.40.6 (bugfix)";
:local Hver [:pick $Cver 2 4];
:local Lver [:pick $Cver 5 6];
:local Nver [:pick $Aver 0 6];

:local Port "808";
:local Repo "http://172.X.Y.Z/umfiles/routeros/$Nver/";

:if ($Cver!=$Aver && $Hver<41) do={
:do {/tool fetch url=($Repo."routeros-".$Arch."-".$Nver.".npk") mode=http port=$Port; :delay 2s; /system reboot;} on-error={:put "# Upadte Download Failed.";}
} else={:if ($Cver=$Aver) do={:put "# $Aver already installed...";}}
} on-error={:put "# Error. Failed to download $Arch packages...";}
You do not have the required permissions to view the files attached to this post.
 
User avatar
jspool
Member
Member
Posts: 472
Joined: Sun Oct 04, 2009 4:06 am
Location: Oregon

Re: Feature Request [Batch Update/ Batch Script]

Tue Mar 27, 2018 8:01 am

Its really not that hard to script. I have a configuration server for each model of router. The routers periodically check the version from the device page and if it is different that what they have it fetches the file from the server and installs it. Each router has an onboard script that checks to see if the routerboard is current and updates if needed. I build some scripts that literally change the entire config based on what plan the customer purchases. The routers check in with the provisioning server and it determines what the customer purchased from the billing system and configs itself accordingly and changes if they switch plans etc all without TR-069. Learn ROS scripting and you can generally find a way to accomplish just about anything.
 
dkykot
just joined
Posts: 2
Joined: Tue Oct 30, 2018 2:56 pm

Re: Feature Request [Batch Update/ Batch Script]

Tue Oct 30, 2018 4:37 pm

How to distribute this script to all Mikrotik devices through a dude?

Who is online

Users browsing this forum: No registered users and 3 guests