mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global: drop script 'global-wait'
All scripts wait for the global functions on their own now.
This commit is contained in:
parent
2db73a189c
commit
d5afc79eed
51 changed files with 137 additions and 81 deletions
|
@ -165,7 +165,6 @@ Available Scripts
|
||||||
* [Comment DHCP leases with info from access list](doc/dhcp-lease-comment.md)
|
* [Comment DHCP leases with info from access list](doc/dhcp-lease-comment.md)
|
||||||
* [Create DNS records for DHCP leases](doc/dhcp-to-dns.md)
|
* [Create DNS records for DHCP leases](doc/dhcp-to-dns.md)
|
||||||
* [Send backup via e-mail](doc/email-backup.md)
|
* [Send backup via e-mail](doc/email-backup.md)
|
||||||
* [Wait for configuration und functions](doc/global-wait.md)
|
|
||||||
* [Send GPS position to server](doc/gps-track.md)
|
* [Send GPS position to server](doc/gps-track.md)
|
||||||
* [Use WPA2 network with hotspot credentials](doc/hotspot-to-wpa.md)
|
* [Use WPA2 network with hotspot credentials](doc/hotspot-to-wpa.md)
|
||||||
* [Update configuration on IPv6 prefix change](doc/ipv6-update.md)
|
* [Update configuration on IPv6 prefix change](doc/ipv6-update.md)
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
:local Seen [ :toarray "" ];
|
||||||
:local Shown [ :toarray "" ];
|
:local Shown [ :toarray "" ];
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
:local Seen [ :toarray "" ];
|
||||||
:local Shown [ :toarray "" ];
|
:local Shown [ :toarray "" ];
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
||||||
# !! or 'interface wireless'!
|
# !! or 'interface wireless'!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
:local Seen [ :toarray "" ];
|
||||||
:local Shown [ :toarray "" ];
|
:local Shown [ :toarray "" ];
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# reset bridge ports to default bridge
|
# reset bridge ports to default bridge
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/bridge-port.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/bridge-port.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global BridgePortTo;
|
:global BridgePortTo;
|
||||||
|
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# toggle bridge ports between default and alt bridge
|
# toggle bridge ports between default and alt bridge
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/bridge-port.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/bridge-port.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global BridgePortTo;
|
:global BridgePortTo;
|
||||||
|
|
||||||
:if ($BridgePortTo != "default") do={
|
:if ($BridgePortTo != "default") do={
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
# download and cleanup packages for CAP installation from CAPsMAN
|
# download and cleanup packages for CAP installation from CAPsMAN
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global CleanFilePath;
|
:global CleanFilePath;
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
# upgrade CAPs one after another
|
# upgrade CAPs one after another
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# renew locally issued certificates
|
# renew locally issued certificates
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/certificate-renew-issued.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/certificate-renew-issued.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global CertIssuedExportPass;
|
:global CertIssuedExportPass;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# check for certificate validity
|
# check for certificate validity
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-certificates.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-certificates.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global CertRenewPass;
|
:global CertRenewPass;
|
||||||
:global CertRenewTime;
|
:global CertRenewTime;
|
||||||
:global CertRenewUrl;
|
:global CertRenewUrl;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# check for RouterOS health state
|
# check for RouterOS health state
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-health.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-health.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global CheckHealthLast;
|
:global CheckHealthLast;
|
||||||
:global CheckHealthTemperature;
|
:global CheckHealthTemperature;
|
||||||
:global CheckHealthTemperatureDeviation;
|
:global CheckHealthTemperatureDeviation;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# check for LTE firmware upgrade, send notification
|
# check for LTE firmware upgrade, send notification
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-lte-firmware-upgrade.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-lte-firmware-upgrade.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global SentLteFirmwareUpgradeNotification;
|
:global SentLteFirmwareUpgradeNotification;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# check for RouterOS update, send notification and/or install
|
# check for RouterOS update, send notification and/or install
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-routeros-update.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-routeros-update.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global SafeUpdateNeighbor;
|
:global SafeUpdateNeighbor;
|
||||||
:global SafeUpdatePatch;
|
:global SafeUpdatePatch;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# upload backup to MikroTik cloud
|
# upload backup to MikroTik cloud
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/cloud-backup.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/cloud-backup.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global BackupPassword;
|
:global BackupPassword;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
||||||
# !! or 'interface wireless'!
|
# !! or 'interface wireless'!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global DailyPskMatchComment;
|
:global DailyPskMatchComment;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global DailyPskMatchComment;
|
:global DailyPskMatchComment;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
||||||
# !! or 'interface wireless'!
|
# !! or 'interface wireless'!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global DailyPskMatchComment;
|
:global DailyPskMatchComment;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
||||||
# !! or 'interface wireless'!
|
# !! or 'interface wireless'!
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# check DHCP leases and add/remove/update DNS entries
|
# check DHCP leases and add/remove/update DNS entries
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Domain;
|
:global Domain;
|
||||||
:global HostNameInZone;
|
:global HostNameInZone;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
|
@ -33,11 +33,9 @@ There is also global configuration:
|
||||||
|
|
||||||
* `BridgePortTo`: specify the configuration to be applied by default
|
* `BridgePortTo`: specify the configuration to be applied by default
|
||||||
|
|
||||||
Install [global-wait](global-wait.md) and add a scheduler to start with
|
Add a scheduler to start with default setup on system startup:
|
||||||
default setup on system startup:
|
|
||||||
|
|
||||||
$ScriptInstallUpdate global-wait;
|
/ system scheduler add name=bridge-port-to-default on-event="/ system script run bridge-port-to-default;" start-time=startup;
|
||||||
/ system scheduler add name=bridge-port-to-default on-event="/ system script { run global-wait; run bridge-port-to-default; }" start-time=startup;
|
|
||||||
|
|
||||||
Usage and invocation
|
Usage and invocation
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -75,11 +73,6 @@ More configuration can be loaded by setting `BridgePortTo`:
|
||||||
* Interfaces `en1` and `en2` are unchanged.
|
* Interfaces `en1` and `en2` are unchanged.
|
||||||
* Interface `en3` is put in bridge `br-intern`.
|
* Interface `en3` is put in bridge `br-intern`.
|
||||||
|
|
||||||
See also
|
|
||||||
--------
|
|
||||||
|
|
||||||
* [Wait for configuration und functions](global-wait.md)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
[◀ Go back to main README](../README.md)
|
[◀ Go back to main README](../README.md)
|
||||||
[▲ Go back to top](#top)
|
[▲ Go back to top](#top)
|
||||||
|
|
|
@ -19,11 +19,9 @@ Just install the script on CAPsMAN device:
|
||||||
|
|
||||||
$ScriptInstallUpdate capsman-download-packages;
|
$ScriptInstallUpdate capsman-download-packages;
|
||||||
|
|
||||||
Optionally install [global-wait](global-wait.md) and add a scheduler to run
|
Optionally add a scheduler to run after startup:
|
||||||
after startup:
|
|
||||||
|
|
||||||
$ScriptInstallUpdate global-wait;
|
/ system scheduler add name=capsman-download-packages on-event="/ system script run capsman-download-packages;" start-time=startup;
|
||||||
/ system scheduler add name=capsman-download-packages on-event="/ system script { run global-wait; run capsman-download-packages; }" start-time=startup;
|
|
||||||
|
|
||||||
Only packages available in older version are downloaded. For initial setup
|
Only packages available in older version are downloaded. For initial setup
|
||||||
place the required packages to CAPsMAN package path (see
|
place the required packages to CAPsMAN package path (see
|
||||||
|
@ -55,7 +53,6 @@ See also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* [Run rolling CAP upgrades from CAPsMAN](capsman-rolling-upgrade.md)
|
* [Run rolling CAP upgrades from CAPsMAN](capsman-rolling-upgrade.md)
|
||||||
* [Wait for configuration und functions](global-wait.md)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
[◀ Go back to main README](../README.md)
|
[◀ Go back to main README](../README.md)
|
||||||
|
|
|
@ -44,7 +44,7 @@ Just run the script:
|
||||||
|
|
||||||
Alternatively running on startup may be desired:
|
Alternatively running on startup may be desired:
|
||||||
|
|
||||||
/ system scheduler add name=check-certificates-startup on-event="/ system script { run global-wait; run check-certificates; }" start-time=startup;
|
/ system scheduler add name=check-certificates-startup on-event="/ system script run check-certificates;" start-time=startup;
|
||||||
|
|
||||||
See also
|
See also
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -12,23 +12,23 @@ passphrase to a pseudo-random string daily.
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
Just install this script and [global-wait](global-wait.md).
|
Just install this script.
|
||||||
|
|
||||||
Depending on whether you use CAPsMAN (`/ caps-man`) or local wireless
|
Depending on whether you use CAPsMAN (`/ caps-man`) or local wireless
|
||||||
interface (`/ interface wireless`) you need to install a different script.
|
interface (`/ interface wireless`) you need to install a different script.
|
||||||
|
|
||||||
For CAPsMAN:
|
For CAPsMAN:
|
||||||
|
|
||||||
$ScriptInstallUpdate daily-psk.capsman,global-wait;
|
$ScriptInstallUpdate daily-psk.capsman;
|
||||||
|
|
||||||
For local interface:
|
For local interface:
|
||||||
|
|
||||||
$ScriptInstallUpdate daily-psk.local,global-wait;
|
$ScriptInstallUpdate daily-psk.local;
|
||||||
|
|
||||||
And add schedulers to run the script:
|
And add schedulers to run the script:
|
||||||
|
|
||||||
/ system scheduler add interval=1d name=daily-psk-nightly on-event="/ system script run daily-psk.local;" start-date=may/23/2018 start-time=03:00:00;
|
/ system scheduler add interval=1d name=daily-psk-nightly on-event="/ system script run daily-psk.local;" start-date=may/23/2018 start-time=03:00:00;
|
||||||
/ system scheduler add name=daily-psk-startup on-event="/ system script { run global-wait; run daily-psk.local; }" start-time=startup;
|
/ system scheduler add name=daily-psk-startup on-event="/ system script run daily-psk.local;" start-time=startup;
|
||||||
|
|
||||||
These will update the passphrase on boot and nightly at 3:00.
|
These will update the passphrase on boot and nightly at 3:00.
|
||||||
|
|
||||||
|
@ -46,11 +46,6 @@ Then add an access list entry:
|
||||||
|
|
||||||
Also notification settings are required for e-mail and telegram.
|
Also notification settings are required for e-mail and telegram.
|
||||||
|
|
||||||
See also
|
|
||||||
--------
|
|
||||||
|
|
||||||
* [Wait for configuration und functions](global-wait.md)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
[◀ Go back to main README](../README.md)
|
[◀ Go back to main README](../README.md)
|
||||||
[▲ Go back to top](#top)
|
[▲ Go back to top](#top)
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
Wait for configuration und functions
|
|
||||||
====================================
|
|
||||||
|
|
||||||
[◀ Go back to main README](../README.md)
|
|
||||||
|
|
||||||
Description
|
|
||||||
-----------
|
|
||||||
|
|
||||||
The global scripts `global-config`, `global-config-overlay` and
|
|
||||||
`global-functions` are run by scheduler at system startup. Running another
|
|
||||||
script at system startup may result in race condition where configuration
|
|
||||||
and/or function are not yet available. This script is supposed to wait
|
|
||||||
for everything being prepared.
|
|
||||||
|
|
||||||
Do **not** add this script `global-wait` to the `global-scripts` scheduler!
|
|
||||||
It would inhibit the initialization of configuration and functions.
|
|
||||||
|
|
||||||
Requirements and installation
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
Just install the script:
|
|
||||||
|
|
||||||
$ScriptInstallUpdate global-wait;
|
|
||||||
|
|
||||||
... and add it to your scheduler, for example in combination with
|
|
||||||
[bridge-port](bridge-port.md):
|
|
||||||
|
|
||||||
/ system scheduler add name=bridge-port-to-default on-event="/ system script { run global-wait; run bridge-port-to-default; }" start-time=startup;
|
|
||||||
|
|
||||||
See also
|
|
||||||
--------
|
|
||||||
|
|
||||||
* [Manage ports in bridge](bridge-port.md)
|
|
||||||
* [Download packages for CAP upgrade from CAPsMAN](capsman-download-packages.md)
|
|
||||||
* [Renew certificates and notify on expiration](check-certificates.md)
|
|
||||||
* [Use wireless network with daily psk](daily-psk.md)
|
|
||||||
|
|
||||||
---
|
|
||||||
[◀ Go back to main README](../README.md)
|
|
||||||
[▲ Go back to top](#top)
|
|
|
@ -6,6 +6,9 @@
|
||||||
# create and email backup and config file
|
# create and email backup and config file
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/email-backup.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/email-backup.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global BackupPassword;
|
:global BackupPassword;
|
||||||
:global BackupSendBinary;
|
:global BackupSendBinary;
|
||||||
:global BackupSendExport;
|
:global BackupSendExport;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
# Make sure all configuration properties are up to date and this
|
# Make sure all configuration properties are up to date and this
|
||||||
# value is in sync with value in script 'global-functions'!
|
# value is in sync with value in script 'global-functions'!
|
||||||
:global GlobalConfigVersion 43;
|
:global GlobalConfigVersion 44;
|
||||||
|
|
||||||
# This is used for DNS and backup file.
|
# This is used for DNS and backup file.
|
||||||
:global Domain "example.com";
|
:global Domain "example.com";
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# Make sure all configuration properties are up to date and this
|
# Make sure all configuration properties are up to date and this
|
||||||
# value is in sync with value in script 'global-functions'!
|
# value is in sync with value in script 'global-functions'!
|
||||||
# Comment or remove to disable change notifications.
|
# Comment or remove to disable change notifications.
|
||||||
:global GlobalConfigVersion 43;
|
:global GlobalConfigVersion 44;
|
||||||
|
|
||||||
# Copy configuration from global-config here and modify it.
|
# Copy configuration from global-config here and modify it.
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
41="Implemented migration mechanism for script updates.";
|
41="Implemented migration mechanism for script updates.";
|
||||||
42="Made severity in terminal output colorful, with opt-out.";
|
42="Made severity in terminal output colorful, with opt-out.";
|
||||||
43="Added queue for e-mail notifications to resend later on error.";
|
43="Added queue for e-mail notifications to resend later on error.";
|
||||||
|
44="Dropped script 'global-wait', all scripts wait on their own now.";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Migration steps to be applied on script updates
|
# Migration steps to be applied on script updates
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/
|
# https://git.eworm.de/cgit/routeros-scripts/about/
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
:global ExpectedConfigVersion 43;
|
:global ExpectedConfigVersion 44;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global GlobalFunctionsReady false;
|
:global GlobalFunctionsReady false;
|
||||||
|
@ -624,13 +624,6 @@
|
||||||
$LogPrintExit warning ("Policies differ for script " . $ScriptVal->"name" . \
|
$LogPrintExit warning ("Policies differ for script " . $ScriptVal->"name" . \
|
||||||
" and its scheduler " . $SchedulerVal->"name" . "!") false;
|
" and its scheduler " . $SchedulerVal->"name" . "!") false;
|
||||||
}
|
}
|
||||||
:if ($SchedulerVal->"name" != "global-scripts" && \
|
|
||||||
$SchedulerVal->"start-time" = "startup" && \
|
|
||||||
$SchedulerVal->"interval" = 0s && \
|
|
||||||
!(($SchedulerVal->"on-event") ~ "\\brun global-wait\\b")) do={
|
|
||||||
$LogPrintExit warning ("Scheduler " . $SchedulerVal->"name" . " starts on startup, " . \
|
|
||||||
"without waiting for global-functions. Run 'global-wait' to avoid race conditions!") false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len $SourceNew ] = 0 && $ScriptUpdatesFetch = true) do={
|
:if ([ :len $SourceNew ] = 0 && $ScriptUpdatesFetch = true) do={
|
||||||
|
|
10
global-wait
10
global-wait
|
@ -1,13 +1,11 @@
|
||||||
#!rsc by RouterOS
|
#!rsc by RouterOS
|
||||||
# RouterOS script: global-wait
|
# RouterOS script: global-wait
|
||||||
# Copyright (c) 2020-2021 Christian Hesse <mail@eworm.de>
|
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
|
||||||
#
|
|
||||||
# wait for global-functions to finish
|
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/global-wait.md
|
|
||||||
|
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
|
|
||||||
:while ($GlobalFunctionsReady != true) do={
|
:while ($GlobalFunctionsReady != true) do={
|
||||||
:delay 500ms;
|
:delay 500ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global LogPrintExit;
|
||||||
|
|
||||||
|
$LogPrintExit warning ("This script 'global-wait' is now useless, please remove it from configuration.") true;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# track gps data by sending json data to http server
|
# track gps data by sending json data to http server
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/gps-track.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/gps-track.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global GpsTrackUrl;
|
:global GpsTrackUrl;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# add private WPA passphrase after hotspot login
|
# add private WPA passphrase after hotspot login
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:local MacAddress $"mac-address";
|
:local MacAddress $"mac-address";
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# update firewall and dns settings on IPv6 prefix change
|
# update firewall and dns settings on IPv6 prefix change
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ipv6-update.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ipv6-update.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:local PdPrefix $"pd-prefix";
|
:local PdPrefix $"pd-prefix";
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# run scripts on DHCP lease
|
# run scripts on DHCP lease
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/lease-script.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/lease-script.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:if ([ :typeof $leaseActIP ] = "nothing" || \
|
:if ([ :typeof $leaseActIP ] = "nothing" || \
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# forward log messages via notification
|
# forward log messages via notification
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/log-forward.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/log-forward.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global LogForwardFilter;
|
:global LogForwardFilter;
|
||||||
:global LogForwardFilterMessage;
|
:global LogForwardFilterMessage;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# act on multiple mode and reset button presses
|
# act on multiple mode and reset button presses
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/mode-button.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/mode-button.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global ModeButton;
|
:global ModeButton;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# monitor netwatch and send notifications
|
# monitor netwatch and send notifications
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-notify.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-notify.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global NetwatchNotify;
|
:global NetwatchNotify;
|
||||||
|
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# visualize ospf instance state via leds
|
# visualize ospf instance state via leds
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ospf-to-leds.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ospf-to-leds.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# download packages and reboot for installation
|
# download packages and reboot for installation
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/packages-update.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/packages-update.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
:global ScriptFromTerminal;
|
:global ScriptFromTerminal;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# run scripts on ppp up
|
# run scripts on ppp up
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ppp-on-up.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/ppp-on-up.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
:local Interface $interface;
|
:local Interface $interface;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# rotate the ntp servers
|
# rotate the ntp servers
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/rotate-ntp.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/rotate-ntp.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global NtpPool;
|
:global NtpPool;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# run action on received SMS
|
# run action on received SMS
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-action.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-action.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global SmsAction;
|
:global SmsAction;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# forward SMS to e-mail
|
# forward SMS to e-mail
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
# ipsec remote peer
|
# ipsec remote peer
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
# update local address of tunnelbroker interface
|
# update local address of tunnelbroker interface
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-tunnelbroker.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-tunnelbroker.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
# create and upload backup and config file
|
# create and upload backup and config file
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/upload-backup.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/upload-backup.md
|
||||||
|
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
:global BackupPassword;
|
:global BackupPassword;
|
||||||
:global BackupSendBinary;
|
:global BackupSendBinary;
|
||||||
:global BackupSendExport;
|
:global BackupSendExport;
|
||||||
|
|
Loading…
Reference in a new issue