mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptLock: do not exit from global function
This commit is contained in:
parent
56e97dd60c
commit
1e8918fdaa
57 changed files with 172 additions and 61 deletions
|
@ -30,7 +30,9 @@
|
|||
:global SymbolForNotification;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -45,7 +45,9 @@
|
|||
$LogPrintExit2 error $ScriptName ("Configured to send neither backup nor config export.") true;
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||
$LogPrintExit2 error $ScriptName ("Device does not have a fallback partition.") true;
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
$LogPrintExit2 error $ScriptName ("Configured to send neither backup nor config export.") true;
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local PackagePath [ $CleanFilePath [ /caps-man/manager/get package-path ] ];
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local PackagePath [ $CleanFilePath [ /caps-man/manager/get package-path ] ];
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local PackagePath [ $CleanFilePath [ /interface/wifi/capsman/get package-path ] ];
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local PackagePath [ $CleanFilePath [ /interface/wifiwave2/capsman/get package-path ] ];
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local InstalledVersion [ /system/package/update/get installed-version ];
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local InstalledVersion [ /system/package/update/get installed-version ];
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local InstalledVersion [ /system/package/update/get installed-version ];
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local InstalledVersion [ /system/package/update/get installed-version ];
|
||||
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global MkDir;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={
|
||||
:local CertVal [ /certificate/get $Cert ];
|
||||
|
|
|
@ -127,7 +127,9 @@
|
|||
[ $FormatLine "Expires in" [ $IfThenElse (($CertVal->"expired") = true) "expired" [ $FormatExpire ($CertVal->"expires-after") ] ] ]);
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
:return ($T->0 * 10 + $T->1);
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local Resource [ /system/resource/get ];
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={
|
||||
:global SentLteFirmwareUpgradeNotification ({});
|
||||
|
|
|
@ -41,7 +41,9 @@
|
|||
:error "Waiting for system to reboot.";
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
/caps-man/access-list/add comment="--- collected above ---" disabled=yes;
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /interface/wireless/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
/interface/wireless/access-list/add comment="--- collected above ---" disabled=yes;
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
:if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
/interface/wifi/access-list/add comment="--- collected above ---" disabled=yes;
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /interface/wifiwave2/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
|
||||
/interface/wifiwave2/access-list/add comment="--- collected above ---" disabled=yes;
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
|
||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local Ttl 5m;
|
||||
:local CommentPrefix ("managed by " . $ScriptName);
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
:global ScriptLock;
|
||||
:global VersionToNum;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local RouterBoard [ /system/routerboard/get ];
|
||||
:if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local ListComment ("managed by " . $ScriptName);
|
||||
|
|
|
@ -1170,8 +1170,7 @@
|
|||
# lock script against multiple invocation
|
||||
:set ScriptLock do={
|
||||
:local Script [ :tostr $1 ];
|
||||
:local DoReturn $2;
|
||||
:local WaitMax ([ :tonum $3 ] * 10);
|
||||
:local WaitMax ([ :tonum $3 ] * 10);
|
||||
|
||||
:global GetRandom20CharAlNum;
|
||||
:global IfThenElse;
|
||||
|
@ -1286,13 +1285,13 @@
|
|||
:if ([ $IsFirstTicket $Script $MyTicket ] = true && [ $TicketCount $Script ] = [ $JobCount $Script ]) do={
|
||||
$RemoveTicket $Script $MyTicket;
|
||||
$CleanupTickets $Script;
|
||||
:return false;
|
||||
:return true;
|
||||
}
|
||||
|
||||
$RemoveTicket $Script $MyTicket;
|
||||
$LogPrintExit2 info $0 ("Script '" . $Script . "' started more than once" . [ $IfThenElse ($WaitCount > 0) \
|
||||
" and timed out waiting for lock" "" ] . "... Aborting.") [ $IfThenElse ($DoReturn = true) false true ];
|
||||
:return true;
|
||||
" and timed out waiting for lock" "" ] . "... Aborting.") false;
|
||||
:return false;
|
||||
}
|
||||
|
||||
# send notification via NotificationFunctions - expects at least two string arguments
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:local CoordinateFormat [ /system/gps/get coordinate-format ];
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
:foreach Server in=[ /ip/dhcp-server/find where comment~"hotspot-to-wpa" ] do={
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
:foreach Server in=[ /ip/dhcp-server/find where comment~"hotspot-to-wpa" ] do={
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
:foreach Server in=[ /ip/dhcp-server/find where comment~"hotspot-to-wpa" ] do={
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local DHCPServers ({});
|
||||
:foreach Server in=[ /ip/dhcp-server/find where comment~"hotspot-to-wpa" ] do={
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $MacAddress ] = 0 || [ :len $UserName ] = 0) do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from hotspot on login.") true;
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $MacAddress ] = 0 || [ :len $UserName ] = 0) do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from hotspot on login.") true;
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $MacAddress ] = 0 || [ :len $UserName ] = 0) do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from hotspot on login.") true;
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $MacAddress ] = 0 || [ :len $UserName ] = 0) do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from hotspot on login.") true;
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local Zone \
|
||||
([ $IfThenElse ($PrefixInZone = true) "ipsec." ] . \
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :typeof $PdPrefix ] = "nothing") do={
|
||||
$LogPrintExit2 error $ScriptName ("This script is supposed to run from ipv6 dhcp-client.") true;
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
$LogPrintExit2 debug $ScriptName ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \
|
||||
"de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC) false;
|
||||
|
||||
$ScriptLock $ScriptName false 10;
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /system/script/job/find where script=$ScriptName ] ] > 1) do={
|
||||
$LogPrintExit2 debug $ScriptName ("More invocations are waiting, exiting early.") false;
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :typeof $LogForwardRateLimit ] = "nothing") do={
|
||||
:set LogForwardRateLimit 0;
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local SettleTime (5m30s - [ /system/resource/get uptime ]);
|
||||
:if ($SettleTime > 0s) do={
|
||||
|
|
|
@ -75,7 +75,9 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Instance in=[ /routing/ospf/instance/find where comment~"^ospf-to-leds," ] do={
|
||||
:local InstanceVal [ /routing/ospf/instance/get $Instance ];
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
:return true;
|
||||
}
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local Update [ /system/package/update/get ];
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
:global ValidateSyntax;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ /tool/sms/get receive-enabled ] = false) do={
|
||||
$LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled.") true;
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
:global ParseKeyValueStore;
|
||||
:global ScriptLock;
|
||||
|
||||
$ScriptLock $ScriptName;
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false) do={
|
||||
$LogPrintExit2 error $ScriptName ("Downloading required certificate failed.") true;
|
||||
|
|
Loading…
Reference in a new issue