mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 18:14:27 +02:00
Merge branch 'script-lock' into next
This commit is contained in:
commit
db223429b7
21 changed files with 57 additions and 0 deletions
|
@ -21,10 +21,12 @@
|
|||
:global LogPrintExit2;
|
||||
:global RandomDelay;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
:global MkDir;
|
||||
:global RandomDelay;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendEMail2;
|
||||
:global SymbolForNotification;
|
||||
:global WaitForFile;
|
||||
|
@ -41,6 +42,7 @@
|
|||
$LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true;
|
||||
}
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||
$LogPrintExit2 error $0 ("Device does not have a fallback partition.") true;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
:global MkDir;
|
||||
:global RandomDelay;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global WaitForFile;
|
||||
|
@ -41,6 +42,7 @@
|
|||
$LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true;
|
||||
}
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
:global LogPrintExit2;
|
||||
:global MkDir;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={
|
||||
:local CertVal [ /certificate/get $Cert ];
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:global IfThenElse;
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global UrlEncode;
|
||||
|
@ -98,6 +99,7 @@
|
|||
[ $FormatLine "Expires in" [ $IfThenElse (($CertVal->"expired") = true) "expired" [ $FormatExpire ($CertVal->"expires-after") ] ] ]);
|
||||
}
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
:foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
|
||||
:global SentLteFirmwareUpgradeNotification;
|
||||
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={
|
||||
:global SentLteFirmwareUpgradeNotification ({});
|
||||
}
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -20,12 +20,14 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $0;
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -11,8 +11,11 @@
|
|||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
:global VersionToNum;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:local RouterBoard [ /system/routerboard/get ];
|
||||
:if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={
|
||||
$LogPrintExit2 info $0 ("Current and upgrade firmware match with version " . \
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
:global Identity;
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:local CoordinateFormat [ /system/gps/get coordinate-format ];
|
||||
:local Gps [ /system/gps/monitor once as-value ];
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
:global EitherOr;
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:local MacAddress $"mac-address";
|
||||
:local UserName $username;
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
:global EscapeForRegEx;
|
||||
:global IfThenElse;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:local Zone \
|
||||
([ $IfThenElse ($PrefixInZone = true) "ipsec." ] . \
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:if ([ :typeof $PdPrefix ] = "nothing") do={
|
||||
$LogPrintExit2 error $0 ("This script is supposed to run from ipv6 dhcp-client.") true;
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:foreach Instance in=[ /routing/ospf/instance/find where comment~"^ospf-to-leds," ] do={
|
||||
:local InstanceVal [ /routing/ospf/instance/get $Instance ];
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
:global CharacterReplace;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
:global CertificateAvailable;
|
||||
:global LogPrintExit2;
|
||||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $0;
|
||||
|
||||
:if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false) do={
|
||||
$LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue