Initial Commit

This commit is contained in:
Grzegorz Budny 2020-04-19 17:57:02 +02:00
parent 73be32da20
commit 510e2311dc
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,25 @@
# RouterOS Fucntion
# Copyright (c) Grzegorz Budny
# Version 1.0
# Last update: 4/19/20
# Automated download of all latest RouterOS standard packages.
# Tool recommended to CAPsMAN and DUDE servers
:global AutoSoftwareDownload do={
/system package update check-for-updates;
:local packageLatest [/system package update get latest-version];
:local packages {"mipsbe"; "smips"; "tile"; "powerpc"; "arm"; "x86"; "mmips"};
:foreach package in=$packages do={
/tool fetch http-method=get mode=https url=("https://download.mikrotik.com/routeros/".$packageLatest."/routeros-".("$package")."-".$packageLatest.".npk") dst-path=($destinationPath."/routeros-".("$package")."-".$packageLatest.".npk");
:log ("...:::Downloading "."/routeros-".("$package")."-".$packageLatest.".npk");
}
}
#Example:
#$AutoSoftwareDownload destinationPath=destination_path

View file

@ -0,0 +1,22 @@
# RouterOS Function
# Copyright (c) Grzegorz Budny
# Version 1.0
# Last update: 4/19/2020
# Simple setup for DUAL WAN failover. Main WAN must be commented as WAN1. Secondary WAN must be commented as WAn2
:global DualWanFailover do={
/ip route add dst-address=8.8.8.8 gateway=[/ip route get value-name=gateway [find distance=1 dst-address=0.0.0.0/0]];
/ip route add dst-address=8.8.4.4 gateway=[/ip route get value-name=gateway [find distance=2 dst-address=0.0.0.0/0]];
/tool netwatch add host=8.8.8.8 interval=00:00:10 \
up-script="/ip route enable [find comment=WAN1 /ip firewall connection remove [find]" down-script="/ip route disable [find comment=WAN1 /ip firewall connection remove [find]";
/tool netwatch add host=8.8.4.4 interval=00:00:10 \
up-script="/ip route enable [find comment=WAN2 /ip firewall connection remove [find]" down-script="/ip route disable [find comment=WAN2 /ip firewall connection remove [find]";
}
$DualWanFailover