diff --git a/RouterOS_All_Software_Download.rsc b/RouterOS_All_Software_Download.rsc new file mode 100644 index 0000000..d642900 --- /dev/null +++ b/RouterOS_All_Software_Download.rsc @@ -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 \ No newline at end of file diff --git a/RouterOS_Dual_WAN_Failover.rsc b/RouterOS_Dual_WAN_Failover.rsc new file mode 100644 index 0000000..7519fae --- /dev/null +++ b/RouterOS_Dual_WAN_Failover.rsc @@ -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 +