From 4aaa144472a1b880398b770b6b529f11e6c9917e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Jun 2023 07:59:34 +0200 Subject: backup-cloud: lock the script --- backup-cloud.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index b6f6025..859892b 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -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={ -- cgit v1.2.3-70-g09d2 From 229e1169990d68090dd8f4b0dcd83c3f3afd1c46 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Jun 2023 07:59:54 +0200 Subject: backup-email: lock the script --- backup-email.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup-email.rsc b/backup-email.rsc index e8837a0..5eb4fcc 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -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={ -- cgit v1.2.3-70-g09d2 From fa851a78387c4145dfa308fd6c767af71f7b79ca Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Jun 2023 19:02:41 +0200 Subject: backup-partition: lock the script --- backup-partition.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backup-partition.rsc b/backup-partition.rsc index 824cb7e..364101c 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -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; -- cgit v1.2.3-70-g09d2 From 1167347ec099563c3129a844c0d02c806368cf6e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Jun 2023 08:00:06 +0200 Subject: backup-upload: lock the script --- backup-upload.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup-upload.rsc b/backup-upload.rsc index 9fb35d8..1ec61a5 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -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={ -- cgit v1.2.3-70-g09d2 From 4420c79e0c98f05f45abfa7ad8da37ffa6aa6fb2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:51:01 +0200 Subject: certificate-renew-issued: lock the script --- certificate-renew-issued.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc index c297b15..2b18a76 100644 --- a/certificate-renew-issued.rsc +++ b/certificate-renew-issued.rsc @@ -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 ]; -- cgit v1.2.3-70-g09d2 From e0714bdfff451c6fc653abbc7007b430d768273a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Jun 2023 08:19:14 +0200 Subject: check-certificates: lock the script --- check-certificates.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check-certificates.rsc b/check-certificates.rsc index a3b0a8f..db9007a 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -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={ -- cgit v1.2.3-70-g09d2 From d2de9be4394b5a8dc8aa93f262440545a046a90c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:56:10 +0200 Subject: check-lte-firmware-upgrade: lock the script --- check-lte-firmware-upgrade.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc index 92ebe51..a2aec01 100644 --- a/check-lte-firmware-upgrade.rsc +++ b/check-lte-firmware-upgrade.rsc @@ -12,6 +12,10 @@ :global SentLteFirmwareUpgradeNotification; +:global ScriptLock; + +$ScriptLock $0; + :if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={ :global SentLteFirmwareUpgradeNotification ({}); } -- cgit v1.2.3-70-g09d2 From 40f2953dde0b07b8868d38f1fee0c6a183e3c005 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:52:03 +0200 Subject: daily-psk: lock the script --- daily-psk.capsman.rsc | 2 ++ daily-psk.local.rsc | 2 ++ daily-psk.template.rsc | 2 ++ 3 files changed, 6 insertions(+) diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc index a24d761..0b5e666 100644 --- a/daily-psk.capsman.rsc +++ b/daily-psk.capsman.rsc @@ -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 diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc index 5e6e30f..df6d962 100644 --- a/daily-psk.local.rsc +++ b/daily-psk.local.rsc @@ -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 diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 966a407..777f6c0 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -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 -- cgit v1.2.3-70-g09d2 From 497915b4a2ea1fe0ef2f8659b9559f22c0aaa23b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:53:49 +0200 Subject: dhcp-lease-comment: lock the script --- dhcp-lease-comment.capsman.rsc | 3 +++ dhcp-lease-comment.local.rsc | 3 +++ dhcp-lease-comment.template.rsc | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index d3b2dc5..89d2c4e 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -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 ]; diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 0d1b2c0..11e92cc 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -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 ]; diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index 28581f4..be28cfd 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -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 ]; -- cgit v1.2.3-70-g09d2 From 51ebbd46d969d6d025270dcab9a746589e1b613b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:54:36 +0200 Subject: firmware-upgrade-reboot: lock the script --- firmware-upgrade-reboot.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc index cc45c38..ec2babc 100644 --- a/firmware-upgrade-reboot.rsc +++ b/firmware-upgrade-reboot.rsc @@ -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 " . \ -- cgit v1.2.3-70-g09d2 From 4176fd058eecb5553b0bbd6c15577b298b4f4d04 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 08:57:13 +0200 Subject: hotspot-to-wpa: lock the script --- hotspot-to-wpa.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hotspot-to-wpa.rsc b/hotspot-to-wpa.rsc index e2de112..d7aeb65 100644 --- a/hotspot-to-wpa.rsc +++ b/hotspot-to-wpa.rsc @@ -13,6 +13,9 @@ :global EitherOr; :global LogPrintExit2; :global ParseKeyValueStore; +:global ScriptLock; + +$ScriptLock $0; :local MacAddress $"mac-address"; :local UserName $username; -- cgit v1.2.3-70-g09d2 From f375b7fbf79660fd2b532c33469d6f2996986179 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:00:15 +0200 Subject: gps-track: lock the script --- gps-track.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gps-track.rsc b/gps-track.rsc index d0d1232..c601e04 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -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 ]; -- cgit v1.2.3-70-g09d2 From 878e1f66f263b8bdfe0a86fd8f2accecf5bd8a4d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:02:15 +0200 Subject: ipsec-to-dns: lock the script --- ipsec-to-dns.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index a476e74..d961865 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -19,6 +19,9 @@ :global EscapeForRegEx; :global IfThenElse; :global LogPrintExit2; +:global ScriptLock; + +$ScriptLock $0; :local Zone \ ([ $IfThenElse ($PrefixInZone = true) "ipsec." ] . \ -- cgit v1.2.3-70-g09d2 From de750f055904f8c95aa2ed889ae6ec8ba9798f97 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:03:10 +0200 Subject: ipv6-update: lock the script --- ipv6-update.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipv6-update.rsc b/ipv6-update.rsc index 2838feb..7e1d34f 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -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; -- cgit v1.2.3-70-g09d2 From cc3a017507d9228aad412287819ed428a4f1a922 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:04:14 +0200 Subject: ospf-to-leds: lock the script --- ospf-to-leds.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc index 12ec820..2dc8448 100644 --- a/ospf-to-leds.rsc +++ b/ospf-to-leds.rsc @@ -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 ]; -- cgit v1.2.3-70-g09d2 From 2861610e5a2ace7d1ce1b234db73d75295f7510f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:06:11 +0200 Subject: update-gre-address: lock the script --- update-gre-address.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update-gre-address.rsc b/update-gre-address.rsc index 2958055..e38839c 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -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 ]; -- cgit v1.2.3-70-g09d2 From befa739e11b04a1b9c5ae2a54f1b37fc920f538a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 09:06:25 +0200 Subject: update-tunnelbroker: lock the script --- update-tunnelbroker.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index 84d7430..a1d5e5e 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -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; -- cgit v1.2.3-70-g09d2