From e851cd5ad0ccb38667ec88a52fdc123cc5a16aee Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 27 Nov 2024 09:57:11 +0100 Subject: [PATCH 001/273] mod/ssh-keys-import: require RouterOS 7.16 Actually the requirement bumped with the change in commits: * 9c945b1a3283bb352707c69630c579cf82484dcb mod/ssh-keys-import: $SSHKeysImportFile: simplify looping lines * 1f526b356121749991fee69cee5a6c728855c8f2 mod/ssh-keys-import: $SSHKeysImport: split with `:deserialize` --- doc/mod/ssh-keys-import.md | 2 +- mod/ssh-keys-import.rsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/mod/ssh-keys-import.md b/doc/mod/ssh-keys-import.md index dcfd95b..344f4bc 100644 --- a/doc/mod/ssh-keys-import.md +++ b/doc/mod/ssh-keys-import.md @@ -4,7 +4,7 @@ Import ssh keys for public key authentication [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.16-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index d6b3b3f..c7b2788 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2024 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.16 # # import ssh keys for public key authentication # https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/ssh-keys-import.md From 6548f83ef4f60efadc3574876680801ee09ef638 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 8 Aug 2024 21:30:46 +0200 Subject: [PATCH 002/273] dhcp-to-dns: explicitly expect type=A... ... which is provided since 7.16beta7 (but require next stable release 7.16 as that is available meanwhile). I had this on my wishlist for a long time, and opened an issue in March 2023 about it (SUP-111312). Back then I changed the code to support both, see commit 779b3b8872b23b784c331d7a454c86439046f5d3. --- dhcp-to-dns.rsc | 8 ++++---- doc/dhcp-to-dns.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 0ab5e2a..9bf506f 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -4,7 +4,7 @@ # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=20 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.16 # # check DHCP leases and add/remove/update DNS entries # https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md @@ -40,7 +40,7 @@ } :local PlaceBefore ([ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ]->0); - :foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix . "\\b") (!type or type=A) ] do={ + :foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix . "\\b") type=A ] do={ :local DnsRecordVal [ /ip/dns/static/get $DnsRecord ]; :local DnsRecordInfo [ $ParseKeyValueStore ($DnsRecordVal->"comment") ]; :local MacInServer ($DnsRecordInfo->"macaddress" . " in " . $DnsRecordInfo->"server"); @@ -83,7 +83,7 @@ :local FullCN ($HostName . "." . $NetDomain); :local MacInServer ($LeaseVal->"active-mac-address" . " in " . $LeaseVal->"server"); - :local DnsRecord [ /ip/dns/static/find where comment=$Comment (!type or type=A) ]; + :local DnsRecord [ /ip/dns/static/find where comment=$Comment type=A ]; :if ([ :len $DnsRecord ] > 0) do={ :local DnsRecordVal [ /ip/dns/static/get $DnsRecord ]; @@ -116,7 +116,7 @@ } } - :if ([ :len [ /ip/dns/static/find where name=$FullA (!type or type=A) ] ] > 1) do={ + :if ([ :len [ /ip/dns/static/find where name=$FullA type=A ] ] > 1) do={ $LogPrintOnce warning $ScriptName ("The name '" . $FullA . "' appeared in more than one A record!"); } } else={ diff --git a/doc/dhcp-to-dns.md b/doc/dhcp-to-dns.md index 572011f..4211d85 100644 --- a/doc/dhcp-to-dns.md +++ b/doc/dhcp-to-dns.md @@ -4,7 +4,7 @@ Create DNS records for DHCP leases [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.16-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) From 09e8b1d21953ad8ba5185b3cb02bbd4b35269963 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 28 Aug 2024 08:53:20 +0200 Subject: [PATCH 003/273] netwatch-dns: explicitly expect type=A... ... which is provided since 7.16beta7 (but require next stable release 7.16 as that is available meanwhile). --- doc/netwatch-dns.md | 2 +- netwatch-dns.rsc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/netwatch-dns.md b/doc/netwatch-dns.md index cdfbd97..6d2c865 100644 --- a/doc/netwatch-dns.md +++ b/doc/netwatch-dns.md @@ -4,7 +4,7 @@ Manage DNS and DoH servers from netwatch [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.16-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index 09d471d..6fbfc89 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2022-2024 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.16 # # monitor and manage dns/doh with netwatch # https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-dns.md @@ -80,7 +80,7 @@ :local HostVal [ /tool/netwatch/get $Host ]; :local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ]; :local HostName [ /ip/dns/static/find where name address=($HostVal->"host") \ - (!type or type="A" or type="AAAA") !disabled !dynamic ]; + (type="A" or type="AAAA") !disabled !dynamic ]; :if ([ :len $HostName ] > 0) do={ :set HostName [ /ip/dns/static/get ($HostName->0) name ]; } From 0d69f8952c25f3bfecd9e33c1520e74eebe42314 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:06:56 +0100 Subject: [PATCH 004/273] global-functions: introduce $ExitError... ... as a simple macro to print error message on unintentional error. --- global-functions.rsc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 6fec6dd..26ccc2a 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -32,6 +32,7 @@ :global DownloadPackage; :global EitherOr; :global EscapeForRegEx; +:global ExitError; :global FetchHuge; :global FetchUserAgentStr; :global FormatLine; @@ -425,6 +426,18 @@ :return $Return; } +# simple macro to print error message on unintentional error +:set ExitError do={ + :local ExitOK [ :tostr $1 ]; + :local ScriptName [ :tostr $2 ]; + + :global LogPrint; + + :if ($ExitOK = "false") do={ + $LogPrint error $ScriptName ("Script exited with error."); + } +} + # fetch huge data to file, read in chunks :set FetchHuge do={ :local ScriptName [ :tostr $1 ]; From ed6739b8bcb93f8e1025401e22db4244c70ac8c6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 8 Dec 2024 22:02:52 +0100 Subject: [PATCH 005/273] global-functions: $ExitError: give script name in message --- global-functions.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 26ccc2a..8941994 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -434,7 +434,7 @@ :global LogPrint; :if ($ExitOK = "false") do={ - $LogPrint error $ScriptName ("Script exited with error."); + $LogPrint error $ScriptName ("Script '" . $ScriptName . "' exited with error."); } } From 36b81fab9474aa0ddc6acdb88f51ef211a1c5563 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:19:54 +0100 Subject: [PATCH 006/273] backup-cloud: use $ExitError to indicate unintentional error --- backup-cloud.rsc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index f70752e..4cc7a58 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -34,6 +35,7 @@ :if ([ $ScriptLock $ScriptName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -44,6 +46,7 @@ :if ([ $MkDir ("tmpfs/backup-cloud") ] = false) do={ $LogPrint error $ScriptName ("Failed creating directory!"); + :set ExitOK true; :error false; } @@ -87,4 +90,6 @@ :set PackagesUpdateBackupFailure true; } /file/remove "tmpfs/backup-cloud"; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 52b5490babc9005fbbb8e0cb1e2ae323a2bd2f70 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:22:11 +0100 Subject: [PATCH 007/273] backup-email: use $ExitError to indicate unintentional error --- backup-email.rsc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backup-email.rsc b/backup-email.rsc index e507c6e..e1d44ea 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -39,17 +40,20 @@ :if ([ :typeof $SendEMail2 ] = "nothing") do={ $LogPrint error $ScriptName ("The module for sending notifications via e-mail is not installed."); + :set ExitOK true; :error false; } :if ($BackupSendBinary != true && \ $BackupSendExport != true) do={ $LogPrint error $ScriptName ("Configured to send neither backup nor config export."); + :set ExitOK true; :error false; } :if ([ $ScriptLock $ScriptName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -69,6 +73,7 @@ :if ([ $MkDir $DirName ] = false) do={ $LogPrint error $ScriptName ("Failed creating directory!"); + :set ExitOK true; :error false; } @@ -116,9 +121,12 @@ :if ($I >= 120) do={ $LogPrint warning $ScriptName ("Files are still available, sending e-mail failed."); :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } :delay 1s; :set I ($I + 1); } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 2c4053cff55a7d0a90f364f7aded280422dc1d65 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:26:34 +0100 Subject: [PATCH 008/273] accesslist-duplicates: use $ExitError to indicate unintentional error --- accesslist-duplicates.capsman.rsc | 5 ++++- accesslist-duplicates.local.rsc | 5 ++++- accesslist-duplicates.template.rsc | 5 ++++- accesslist-duplicates.wifi.rsc | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/accesslist-duplicates.capsman.rsc b/accesslist-duplicates.capsman.rsc index d6e2928..ce0ce11 100644 --- a/accesslist-duplicates.capsman.rsc +++ b/accesslist-duplicates.capsman.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,4 +32,6 @@ } :set ($Seen->$Mac) 1; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/accesslist-duplicates.local.rsc b/accesslist-duplicates.local.rsc index e90842d..aa78fe8 100644 --- a/accesslist-duplicates.local.rsc +++ b/accesslist-duplicates.local.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,4 +32,6 @@ } :set ($Seen->$Mac) 1; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc index d275340..d0c282d 100644 --- a/accesslist-duplicates.template.rsc +++ b/accesslist-duplicates.template.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -40,4 +41,6 @@ } :set ($Seen->$Mac) 1; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/accesslist-duplicates.wifi.rsc b/accesslist-duplicates.wifi.rsc index f4dae4b..b1444e3 100644 --- a/accesslist-duplicates.wifi.rsc +++ b/accesslist-duplicates.wifi.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,4 +32,6 @@ } :set ($Seen->$Mac) 1; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 95030b9b74db03cf67c4702c82bb1d1224c9690e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:28:30 +0100 Subject: [PATCH 009/273] backup-partition: use $ExitError to indicate unintentional error --- backup-partition.rsc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/backup-partition.rsc b/backup-partition.rsc index 51df454..f1e1c17 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -42,12 +43,14 @@ :if ([ $ScriptLock $ScriptName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } :if ([ :len [ /partitions/find ] ] < 2) do={ $LogPrint error $ScriptName ("Device does not have a fallback partition."); :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } @@ -56,6 +59,7 @@ :if ([ :len $ActiveRunning ] < 1) do={ $LogPrint error $ScriptName ("Device is not running from active partition."); :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } @@ -65,6 +69,7 @@ :if ([ :len $FallbackTo ] < 1) do={ $LogPrint error $ScriptName ("There is no inactive partition named '" . $FallbackToName . "'."); :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } @@ -74,6 +79,7 @@ :if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={ :if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } } @@ -86,6 +92,7 @@ ($NumInstalled & $BitMask) != ($NumLatest & $BitMask)) do={ :if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } } @@ -103,6 +110,9 @@ /system/scheduler/remove [ find where name="running-from-backup-partition" ]; $LogPrint error $ScriptName ("Failed saving configuration to partition '" . $FallbackToName . "'!"); :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 268743ef6be5c400ec9fcb044e4961c5d8d9b531 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:29:02 +0100 Subject: [PATCH 010/273] backup-upload: use $ExitError to indicate unintentional error --- backup-upload.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backup-upload.rsc b/backup-upload.rsc index 8d96eba..12698e9 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -43,11 +44,13 @@ :if ($BackupSendBinary != true && \ $BackupSendExport != true) do={ $LogPrint error $ScriptName ("Configured to send neither backup nor config export."); + :set ExitOK true; :error false; } :if ([ $ScriptLock $ScriptName ] = false) do={ :set PackagesUpdateBackupFailure true; + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -67,6 +70,7 @@ :if ([ $MkDir $DirName ] = false) do={ $LogPrint error $ScriptName ("Failed creating directory!"); + :set ExitOK true; :error false; } @@ -158,4 +162,6 @@ :set PackagesUpdateBackupFailure true; } /file/remove $DirName; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From c909bef613884bf67d239a1e6c0bed4e3d7a112e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 011/273] capsman-download-packages: use $ExitError to indicate unintentional error --- capsman-download-packages.capsman.rsc | 8 +++++++- capsman-download-packages.template.rsc | 8 +++++++- capsman-download-packages.wifi.rsc | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index f2ff024..1802884 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -25,6 +26,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -35,6 +37,7 @@ :if ([ :len $PackagePath ] = 0) do={ $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :set ExitOK true; :error false; } @@ -42,6 +45,7 @@ :if ([ $MkDir $PackagePath ] = false) do={ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $PackagePath . ") failed!"); + :set ExitOK true; :error false; } $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ @@ -82,4 +86,6 @@ /caps-man/remote-cap/upgrade [ find where version!=$InstalledVersion ]; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index ad9b926..72edaa9 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -26,6 +27,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -37,6 +39,7 @@ :if ([ :len $PackagePath ] = 0) do={ $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :set ExitOK true; :error false; } @@ -44,6 +47,7 @@ :if ([ $MkDir $PackagePath ] = false) do={ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $PackagePath . ") failed!"); + :set ExitOK true; :error false; } $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ @@ -93,4 +97,6 @@ /interface/wifi/capsman/remote-cap/upgrade [ find where version!=$InstalledVersion ]; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 056136f..74a5d9d 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -25,6 +26,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -35,6 +37,7 @@ :if ([ :len $PackagePath ] = 0) do={ $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :set ExitOK true; :error false; } @@ -42,6 +45,7 @@ :if ([ $MkDir $PackagePath ] = false) do={ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $PackagePath . ") failed!"); + :set ExitOK true; :error false; } $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ @@ -84,4 +88,6 @@ /interface/wifi/capsman/remote-cap/upgrade [ find where version!=$InstalledVersion ]; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 172d43288e2117f2a687df6168d2d461e780a8c3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 012/273] capsman-rolling-upgrade: use $ExitError to indicate unintentional error --- capsman-rolling-upgrade.capsman.rsc | 6 +++++- capsman-rolling-upgrade.template.rsc | 6 +++++- capsman-rolling-upgrade.wifi.rsc | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/capsman-rolling-upgrade.capsman.rsc b/capsman-rolling-upgrade.capsman.rsc index f287ea3..d0f9fb8 100644 --- a/capsman-rolling-upgrade.capsman.rsc +++ b/capsman-rolling-upgrade.capsman.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -22,6 +23,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -43,4 +45,6 @@ :delay ($Delay . "s"); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/capsman-rolling-upgrade.template.rsc b/capsman-rolling-upgrade.template.rsc index 3d98747..1bd5f2a 100644 --- a/capsman-rolling-upgrade.template.rsc +++ b/capsman-rolling-upgrade.template.rsc @@ -16,6 +16,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -23,6 +24,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -51,4 +53,6 @@ :delay ($Delay . "s"); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/capsman-rolling-upgrade.wifi.rsc b/capsman-rolling-upgrade.wifi.rsc index 369dccc..c9e6622 100644 --- a/capsman-rolling-upgrade.wifi.rsc +++ b/capsman-rolling-upgrade.wifi.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -22,6 +23,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -44,4 +46,6 @@ :delay ($Delay . "s"); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From dc7642c1fd3c3029e3993d9ff73b7743ec8e0ea8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 013/273] certificate-renew-issued: use $ExitError to indicate unintentional error --- certificate-renew-issued.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc index f2c1dfe..ce61f7d 100644 --- a/certificate-renew-issued.rsc +++ b/certificate-renew-issued.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -21,6 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -45,4 +47,6 @@ $LogPrint info $ScriptName ("Issued a new certificate for '" . $CertVal->"common-name" . "'."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 00487f93d48e5e7547281808225d108eeeae586f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 014/273] check-certificates: use $ExitError to indicate unintentional error --- check-certificates.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 7aaac84..52cfc5e 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -133,6 +134,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -218,4 +220,6 @@ ", it is invalid after " . ($CertVal->"invalid-after") . "."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 451df78dd8371288413fd45064141b6063e36187 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 015/273] check-health: use $ExitError to indicate unintentional error --- check-health.rsc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check-health.rsc b/check-health.rsc index 540336d..495b450 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -40,6 +41,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -78,6 +80,7 @@ :if ([ :len [ /system/health/find ] ] = 0) do={ $LogPrint debug $ScriptName ("Your device does not provide any health values."); + :set ExitOK true; :error true; } @@ -175,4 +178,6 @@ } :set ($CheckHealthLast->$Name) $Value; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 91c8d306558c056792ff8132caa77fdf0bda059a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 016/273] check-lte-firmware-upgrade: use $ExitError to indicate unintentional error --- check-lte-firmware-upgrade.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc index 2e52c2a..898d6f1 100644 --- a/check-lte-firmware-upgrade.rsc +++ b/check-lte-firmware-upgrade.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -19,6 +20,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -100,4 +102,6 @@ :foreach Interface in=[ /interface/lte/find ] do={ $CheckInterface $ScriptName $Interface; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 9d17beef03ace2d75c9e2f9f98fa297707c9e0e3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 017/273] check-routeros-update: use $ExitError to indicate unintentional error --- check-routeros-update.rsc | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 0624808..510acd9 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -34,20 +35,24 @@ :global WaitFullyConnected; :local DoUpdate do={ + :global LogPrint; + :if ([ :len [ /system/script/find where name="packages-update" ] ] > 0) do={ /system/script/run packages-update; } else={ /system/package/update/install without-paging; } - :error "Waiting for system to reboot."; + $LogPrint info $0 ("Waiting for system to reboot."); } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; :if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={ + :set ExitOK true; :error "A reboot for update is already scheduled."; } @@ -59,11 +64,13 @@ :if ([ $ScriptFromTerminal $ScriptName ] = true) do={ $LogPrint info $ScriptName ("System is already up to date."); } + :set ExitOK true; :error true; } :if ([ :len ($Update->"latest-version") ] = 0) do={ $LogPrint info $ScriptName ("Received an empty version string from server."); + :set ExitOK true; :error false; } @@ -76,6 +83,7 @@ :if ($NumLatest < [ $VersionToNum "7.0" ]) do={ $LogPrint warning $ScriptName ("The version '" . ($Update->"latest-version") . "' is not a valid version."); + :set ExitOK true; :error false; } @@ -88,6 +96,8 @@ message=("Installing ALL versions automatically, including " . $Update->"latest-version" . \ "... Updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; + :set ExitOK true; + :error true; } :if ($SafeUpdatePatch = true && $NumInstalledFeature = $NumLatestFeature) do={ @@ -97,6 +107,8 @@ message=("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; + :set ExitOK true; + :error true; } :if ($SafeUpdateNeighbor = true) do={ @@ -111,6 +123,8 @@ message=("Seen a neighbor (" . $Neighbor . ") running version " . $Update->"latest-version" . \ " from " . $Update->"channel" . ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; + :set ExitOK true; + :error true; } } @@ -131,6 +145,8 @@ message=("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; + :set ExitOK true; + :error true; } } @@ -140,6 +156,7 @@ :if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={ /system/package/update/set channel=stable; $LogPrint info $ScriptName ("Switched to channel 'stable', please re-run!"); + :set ExitOK true; :error true; } } @@ -147,6 +164,8 @@ :put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]"); :if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={ $DoUpdate; + :set ExitOK true; + :error true; } else={ :put "Canceled..."; } @@ -155,6 +174,7 @@ :if ($SentRouterosUpdateNotification = $Update->"latest-version") do={ $LogPrint info $ScriptName ("Already sent the RouterOS update notification for version " . \ $Update->"latest-version" . "."); + :set ExitOK true; :error true; } @@ -170,6 +190,7 @@ :if ($SentRouterosUpdateNotification = $Update->"latest-version") do={ $LogPrint info $ScriptName ("Already sent the RouterOS downgrade notification for version " . \ $Update->"latest-version" . "."); + :set ExitOK true; :error true; } @@ -182,4 +203,6 @@ " is available for downgrade."); :set SentRouterosUpdateNotification ($Update->"latest-version"); } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From bf322781d17629c3254520766ae540fb3ae846be Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 018/273] collect-wireless-mac: use $ExitError to indicate unintentional error --- collect-wireless-mac.capsman.rsc | 6 +++++- collect-wireless-mac.local.rsc | 6 +++++- collect-wireless-mac.template.rsc | 6 +++++- collect-wireless-mac.wifi.rsc | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc index 9efa9ef..77fd6e3 100644 --- a/collect-wireless-mac.capsman.rsc +++ b/collect-wireless-mac.capsman.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -29,6 +30,7 @@ :global SymbolForNotification; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -93,4 +95,6 @@ $LogPrint debug $ScriptName ("No mac address available... Ignoring."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc index 27c9d1c..dc7be19 100644 --- a/collect-wireless-mac.local.rsc +++ b/collect-wireless-mac.local.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -29,6 +30,7 @@ :global SymbolForNotification; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -94,4 +96,6 @@ $LogPrint debug $ScriptName ("No mac address available... Ignoring."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc index d41c17d..34b1695 100644 --- a/collect-wireless-mac.template.rsc +++ b/collect-wireless-mac.template.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -30,6 +31,7 @@ :global SymbolForNotification; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -111,4 +113,6 @@ $LogPrint debug $ScriptName ("No mac address available... Ignoring."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc index 0075320..23c93b0 100644 --- a/collect-wireless-mac.wifi.rsc +++ b/collect-wireless-mac.wifi.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -29,6 +30,7 @@ :global SymbolForNotification; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -93,4 +95,6 @@ $LogPrint debug $ScriptName ("No mac address available... Ignoring."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From f9a6916827b3954637f52ac726d937e04a471e3e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:51 +0100 Subject: [PATCH 019/273] daily-psk.capsman: use $ExitError to indicate unintentional error --- daily-psk.capsman.rsc | 6 +++++- daily-psk.local.rsc | 6 +++++- daily-psk.template.rsc | 6 +++++- daily-psk.wifi.rsc | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc index 0562e39..263f6e5 100644 --- a/daily-psk.capsman.rsc +++ b/daily-psk.capsman.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,6 +32,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -89,4 +91,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc index 0bef0e9..f0757e1 100644 --- a/daily-psk.local.rsc +++ b/daily-psk.local.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,6 +32,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -88,4 +90,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 9d71958..7e36b5a 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -32,6 +33,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -104,4 +106,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/daily-psk.wifi.rsc b/daily-psk.wifi.rsc index 83a896c..293f0e4 100644 --- a/daily-psk.wifi.rsc +++ b/daily-psk.wifi.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -31,6 +32,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -89,4 +91,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 87cde2cc2fe8604457f9fd4826abac1409d88a0d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 020/273] dhcp-lease-comment: use $ExitError to indicate unintentional error --- dhcp-lease-comment.capsman.rsc | 6 +++++- dhcp-lease-comment.local.rsc | 6 +++++- dhcp-lease-comment.template.rsc | 6 +++++- dhcp-lease-comment.wifi.rsc | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index c435ec3..5ac0009 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -21,6 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -36,4 +38,6 @@ /ip/dhcp-server/lease/set comment=$NewComment $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 27e6605..1b74d93 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -21,6 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -36,4 +38,6 @@ /ip/dhcp-server/lease/set comment=$NewComment $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index c562ca2..8f1ad47 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -22,6 +23,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -41,4 +43,6 @@ /ip/dhcp-server/lease/set comment=$NewComment $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc index ba617d7..d3741c5 100644 --- a/dhcp-lease-comment.wifi.rsc +++ b/dhcp-lease-comment.wifi.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -21,6 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -36,4 +38,6 @@ /ip/dhcp-server/lease/set comment=$NewComment $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From c8d423c7d59a9051914d5dd676bcd997d7e9854b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 021/273] dhcp-to-dns: use $ExitError to indicate unintentional error --- dhcp-to-dns.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 9bf506f..ad55c4d 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -27,6 +28,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -123,4 +125,6 @@ $LogPrint debug $ScriptName ("No address available... Ignoring."); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 590030d391d523bc555c192c5f84f9cdb6504abd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 022/273] firmware-upgrade-reboot: use $ExitError to indicate unintentional error --- firmware-upgrade-reboot.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc index 74847ac..9655903 100644 --- a/firmware-upgrade-reboot.rsc +++ b/firmware-upgrade-reboot.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -19,6 +20,7 @@ :global VersionToNum; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -26,10 +28,12 @@ :if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={ $LogPrint info $ScriptName ("Current and upgrade firmware match with version " . \ $RouterBoard->"current-firmware" . "."); + :set ExitOK true; :error true; } :if ([ $VersionToNum ($RouterBoard->"current-firmware") ] > [ $VersionToNum ($RouterBoard->"upgrade-firmware") ]) do={ $LogPrint info $ScriptName ("Different firmware version is available, but it is a downgrade. Ignoring."); + :set ExitOK true; :error true; } @@ -51,4 +55,6 @@ $LogPrint info $ScriptName ("Firmware upgrade successful, rebooting."); /system/reboot; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 923a6385bf8fcb770a70650318d96f0571d7297e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 023/273] fw-addr-lists: use $ExitError to indicate unintentional error --- fw-addr-lists.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 34b2fcc..6682f4a 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -36,6 +37,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -184,4 +186,6 @@ " - renewed: " . [ $HumanReadableNum $CntRenew 1000 ] . \ " - removed: " . [ $HumanReadableNum $CntRemove 1000 ]); } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 90cfa83d95baf440544a331fd60f9903afa1fead Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 024/273] gps-track: use $ExitError to indicate unintentional error --- gps-track.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gps-track.rsc b/gps-track.rsc index a2ea9ff..c0ecac4 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -23,6 +24,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } $WaitFullyConnected; @@ -45,4 +47,6 @@ } else={ $LogPrint debug $ScriptName ("GPS data not valid."); } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From f7b96aa3e93f98b7a8dd076e34b7c302fe436f50 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 025/273] hotspot-to-wpa-cleanup: use $ExitError to indicate unintentional error --- hotspot-to-wpa-cleanup.capsman.rsc | 6 +++++- hotspot-to-wpa-cleanup.template.rsc | 6 +++++- hotspot-to-wpa-cleanup.wifi.rsc | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index e935850..8a38213 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -23,6 +24,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -72,4 +74,6 @@ /ip/dhcp-server/lease/remove $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index fa99b5d..e8d2dfb 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -15,6 +15,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -24,6 +25,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -79,4 +81,6 @@ /ip/dhcp-server/lease/remove $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index d3f859e..e2ef1fd 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -23,6 +24,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } @@ -72,4 +74,6 @@ /ip/dhcp-server/lease/remove $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From ff00c27f990b851b9d14f708aecae6087fedc011 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:55:12 +0100 Subject: [PATCH 026/273] global-functions: $ExitError: give matching message for functions --- global-functions.rsc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 8941994..6c74c2f 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -428,13 +428,15 @@ # simple macro to print error message on unintentional error :set ExitError do={ - :local ExitOK [ :tostr $1 ]; - :local ScriptName [ :tostr $2 ]; + :local ExitOK [ :tostr $1 ]; + :local Name [ :tostr $2 ]; + :global IfThenElse; :global LogPrint; :if ($ExitOK = "false") do={ - $LogPrint error $ScriptName ("Script '" . $ScriptName . "' exited with error."); + $LogPrint error $Name ([ $IfThenElse ([ :pick $Name 0 1 ] = "\$") \ + "Function" "Script" ] . " '" . $Name . "' exited with error."); } } From 8e12453058ae848a6d61c104ab6aa22902205d98 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 027/273] hotspot-to-wpa: use $ExitError to indicate unintentional error --- hotspot-to-wpa.capsman.rsc | 8 +++++++- hotspot-to-wpa.template.rsc | 8 +++++++- hotspot-to-wpa.wifi.rsc | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc index b85c591..e57d327 100644 --- a/hotspot-to-wpa.capsman.rsc +++ b/hotspot-to-wpa.capsman.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -25,11 +26,13 @@ :local UserName $username; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from hotspot on login."); + :set ExitOK true; :error false; } @@ -57,6 +60,7 @@ :if ($Template->"action" = "reject") do={ $LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'."); + :set ExitOK true; :error true; } @@ -95,4 +99,6 @@ :delay 2s; /caps-man/access-list/set $Entry action=accept; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc index 44607cc..efe37d0 100644 --- a/hotspot-to-wpa.template.rsc +++ b/hotspot-to-wpa.template.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -26,11 +27,13 @@ :local UserName $username; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from hotspot on login."); + :set ExitOK true; :error false; } @@ -64,6 +67,7 @@ :if ($Template->"action" = "reject") do={ $LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'."); + :set ExitOK true; :error true; } @@ -115,4 +119,6 @@ :delay 2s; /caps-man/access-list/set $Entry action=accept; /interface/wifi/access-list/set $Entry action=accept; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc index 25933c6..6242d04 100644 --- a/hotspot-to-wpa.wifi.rsc +++ b/hotspot-to-wpa.wifi.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -25,11 +26,13 @@ :local UserName $username; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from hotspot on login."); + :set ExitOK true; :error false; } @@ -57,6 +60,7 @@ :if ($Template->"action" = "reject") do={ $LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'."); + :set ExitOK true; :error true; } @@ -92,4 +96,6 @@ :delay 2s; /interface/wifi/access-list/set $Entry action=accept; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 8c5bd8f5e2a5943e720e6086c1aec74ddb81eaf1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:02:04 +0100 Subject: [PATCH 028/273] global-functions: $ScriptInstallUpdate: use $ExitError to indicate unintentional error --- global-functions.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 6c74c2f..743c50e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1018,7 +1018,7 @@ } # install new scripts, update existing scripts -:set ScriptInstallUpdate do={ +:set ScriptInstallUpdate do={ :do { :local Scripts [ :toarray $1 ]; :local NewComment [ :tostr $2 ]; @@ -1237,7 +1237,9 @@ :set GlobalConfigChanges; :set GlobalConfigMigration; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # lock script against multiple invocation :set ScriptLock do={ From a6fd6bd80cf827a417549c5d433630efcbf1b8b6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 029/273] ipsec-to-dns: use $ExitError to indicate unintentional error --- ipsec-to-dns.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index bd74a8f..47676ca 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -26,6 +27,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -76,4 +78,6 @@ /ip/dns/static/add name=$Fqdn address=($PeerVal->"dynamic-address") ttl=$Ttl comment=$Comment place-before=$PlaceBefore; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 5b9031ccca75e7e1ba8479af1ae180ae8422ac74 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 11:06:38 +0100 Subject: [PATCH 030/273] global-functions: $SendNotification: use $ExitError to indicate unintentional error --- global-functions.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 743c50e..625f8cd 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1374,11 +1374,13 @@ } # send notification via NotificationFunctions - expects at least two string arguments -:set SendNotification do={ +:set SendNotification do={ :do { :global SendNotification2; $SendNotification2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via NotificationFunctions - expects one array argument :set SendNotification2 do={ From 82de8bd935c5a2ccdaf3bfb9db732bdec0ce7d96 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 031/273] ipv6-update: use $ExitError to indicate unintentional error --- ipv6-update.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ipv6-update.rsc b/ipv6-update.rsc index ccc0eb9..ea1d444 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -22,16 +23,19 @@ :local PdPrefix $"pd-prefix"; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ :typeof $NaAddress ] = "str") do={ $LogPrint info $ScriptName ("An address (" . $NaAddress . ") was acquired, not a prefix. Ignoring."); + :set ExitOK true; :error false; } :if ([ :typeof $PdPrefix ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from ipv6 dhcp-client."); + :set ExitOK true; :error false; } @@ -90,4 +94,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 1fe90a6e9aeaba7350f13f52cc9a196a0bc8ca1c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:03:41 +0100 Subject: [PATCH 032/273] mode-button: $ModeButtonScheduler: use $ExitError to indicate unintentional error --- mode-button.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mode-button.rsc b/mode-button.rsc index 2d428ed..90fe80e 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -25,7 +25,7 @@ :if ([ :len $Scheduler ] = 0) do={ $LogPrint info $ScriptName ("Creating scheduler _ModeButtonScheduler, counting presses..."); - :global ModeButtonScheduler do={ + :global ModeButtonScheduler do={ :do { :local FuncName $0; :global ModeButton; @@ -81,7 +81,9 @@ } else={ $LogPrint info $FuncName ("No action defined for " . $Count . " mode-button presses."); } - } + } on-error={ + :global ExitError; $ExitError false $0; + } } /system/scheduler/add name="_ModeButtonScheduler" \ on-event=":global ModeButtonScheduler; \$ModeButtonScheduler;" interval=3s; } else={ From 177a1e798a09115ecc9241f5f39065a2583bcfac Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 033/273] lease-script: use $ExitError to indicate unintentional error --- lease-script.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lease-script.rsc b/lease-script.rsc index f484414..995c7e4 100644 --- a/lease-script.rsc +++ b/lease-script.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -25,6 +26,7 @@ [ :typeof $leaseServerName ] = "nothing" || \ [ :typeof $leaseBound ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from ip dhcp-server."); + :set ExitOK true; :error false; } @@ -32,11 +34,13 @@ "de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC); :if ([ $ScriptLock $ScriptName 10 ] = false) do={ + :set ExitOK true; :error false; } :if ([ :len [ /system/script/job/find where script=$ScriptName ] ] > 1) do={ $LogPrint debug $ScriptName ("More invocations are waiting, exiting early."); + :set ExitOK true; :error true; } @@ -56,4 +60,6 @@ $LogPrint warning $ScriptName ("Running script '" . $Script . "' failed!"); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 5db686a15ccd21ed3a190cd4c9eea0bcc6e56abd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:09:05 +0100 Subject: [PATCH 034/273] mod/bridge-port-to: $BridgePortTo: use $ExitError to indicate unintentional error --- mod/bridge-port-to.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc index 7dae679..9e7b911 100644 --- a/mod/bridge-port-to.rsc +++ b/mod/bridge-port-to.rsc @@ -10,7 +10,7 @@ :global BridgePortTo; -:set BridgePortTo do={ +:set BridgePortTo do={ :do { :local BridgePortTo [ :tostr $1 ]; :global IfThenElse; @@ -65,4 +65,6 @@ $LogPrint info $0 ("Re-enabling interfaces..."); /interface/ethernet/enable $InterfaceReEnable; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } From da7a031081bcbb4c563bb8b56f7ee150c32b54c0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 035/273] log-forward: use $ExitError to indicate unintentional error --- log-forward.rsc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/log-forward.rsc b/log-forward.rsc index e0d8f35..8e660fc 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -33,6 +34,7 @@ :global SymbolForNotification; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -43,6 +45,7 @@ :if ($LogForwardRateLimit > 30) do={ :set LogForwardRateLimit ($LogForwardRateLimit - 1); $LogPrint info $ScriptName ("Rate limit in action, not forwarding logs, if any!"); + :set ExitOK true; :error false; } @@ -100,4 +103,6 @@ :local LogAll [ /log/find ]; :set LogForwardLast ($LogAll->([ :len $LogAll ] - 1) ); -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 495232b299bafadc4d21551f094c3c42fa090f57 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:09:48 +0100 Subject: [PATCH 036/273] mod/bridge-port-vlan: $BridgePortVlan: use $ExitError to indicate unintentional error --- mod/bridge-port-vlan.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/bridge-port-vlan.rsc b/mod/bridge-port-vlan.rsc index c9f55ae..18fa2db 100644 --- a/mod/bridge-port-vlan.rsc +++ b/mod/bridge-port-vlan.rsc @@ -10,7 +10,7 @@ :global BridgePortVlan; -:global BridgePortVlan do={ +:global BridgePortVlan do={ :do { :local ConfigTo [ :tostr $1 ]; :global IfThenElse; @@ -74,4 +74,6 @@ $LogPrint info $0 ("Re-enabling interfaces..."); /interface/ethernet/enable $InterfaceReEnable; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } From b7ce6aee71733a1e84b911a21c8868b8d2279c10 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 037/273] mode-button: use $ExitError to indicate unintentional error --- mode-button.rsc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mode-button.rsc b/mode-button.rsc index 3bd922b..24de453 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -83,4 +84,6 @@ $LogPrint debug $ScriptName ("Updating scheduler _ModeButtonScheduler..."); /system/scheduler/set $Scheduler start-time=[ /system/clock/get time ]; } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 05cb87f475ffc3f9fdc1fa6988925e79a3dacd38 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:10:08 +0100 Subject: [PATCH 038/273] mod/inspectvar: $InspectVar: use $ExitError to indicate unintentional error --- mod/inspectvar.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/inspectvar.rsc b/mod/inspectvar.rsc index 73205b2..0209214 100644 --- a/mod/inspectvar.rsc +++ b/mod/inspectvar.rsc @@ -12,11 +12,13 @@ :global InspectVarReturn; # inspect variable and print on terminal -:set InspectVar do={ +:set InspectVar do={ :do { :global InspectVarReturn; :put [ :tocrlf [ $InspectVarReturn $1 ] ]; -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # inspect variable and return formatted string :set InspectVarReturn do={ From d89a3694850a76e487b139eebf24572344a5502e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:08:36 +0100 Subject: [PATCH 039/273] netwatch-dns: use $ExitError to indicate unintentional error --- netwatch-dns.rsc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index 6fbfc89..a704c84 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -24,12 +25,14 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :local SettleTime (5m30s - [ /system/resource/get uptime ]); :if ($SettleTime > 0s) do={ $LogPrint info $ScriptName ("System just booted, giving netwatch " . $SettleTime . " to settle."); + :set ExitOK true; :error true; } @@ -92,6 +95,7 @@ :if ($DohCurrent = $HostInfo->"doh-url") do={ $LogPrint debug $ScriptName ("Current DoH server is still up: " . $DohCurrent); + :set ExitOK true; :error true; } @@ -132,6 +136,7 @@ } /ip/dns/cache/flush; $LogPrint info $ScriptName ("Setting DoH server: " . ($DohServer->"doh-url")); + :set ExitOK true; :error true; } else={ $LogPrint warning $ScriptName ("Received unexpected response from DoH server: " . \ @@ -139,4 +144,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 34172e4c78cc5a6d0fe99df279e42a8794f84c94 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:10:27 +0100 Subject: [PATCH 040/273] mod/ipcalc: $IPCalc: use $ExitError to indicate unintentional error --- mod/ipcalc.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/ipcalc.rsc b/mod/ipcalc.rsc index 003bdc3..021cd30 100644 --- a/mod/ipcalc.rsc +++ b/mod/ipcalc.rsc @@ -12,7 +12,7 @@ :global IPCalcReturn; # print netmask, network, min host, max host and broadcast -:set IPCalc do={ +:set IPCalc do={ :do { :local Input [ :tostr $1 ]; :global FormatLine; @@ -27,7 +27,9 @@ [ $FormatLine "HostMin" ($Values->"hostmin") ] . "\n" . \ [ $FormatLine "HostMax" ($Values->"hostmax") ] . "\n" . \ [ $FormatLine "Broadcast" ($Values->"broadcast") ]) ]; -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # calculate and return netmask, network, min host, max host and broadcast :set IPCalcReturn do={ From bdc15eaefb51b40b3d414f0e94bfa22233b0f2a4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 041/273] netwatch-notify: use $ExitError to indicate unintentional error --- netwatch-notify.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index a49d0cd..f1e87bd 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -75,6 +76,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -218,4 +220,6 @@ "since"=($Metric->"since") }; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 5450618723dabf9d42857047ea906c9fc87886dd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 08:51:50 +0100 Subject: [PATCH 042/273] mod/notification-email: $FlushEmailQueue: use $ExitError to indicate unintentional error --- mod/notification-email.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 3d62ddf..ff4188c 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -34,7 +34,7 @@ } # flush e-mail queue -:set FlushEmailQueue do={ +:set FlushEmailQueue do={ :do { :global EmailQueue; :global EitherOr; @@ -113,7 +113,9 @@ } else={ /system/scheduler/set interval=1m comment="Waiting for retry..." $Scheduler; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # generate filter for log-forward :set LogForwardFilterLogForwarding do={ From eeb76c227cbc04c410e7062daef4cda9cb3d5bf3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 043/273] ospf-to-leds: use $ExitError to indicate unintentional error --- ospf-to-leds.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc index b78faa4..d96e763 100644 --- a/ospf-to-leds.rsc +++ b/ospf-to-leds.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -19,6 +20,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -42,4 +44,6 @@ /system/leds/set type=off [ find where leds=$LED ]; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 1927dc505a88ef5ecb86d1d925cf44a5225b4b7c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 11:09:44 +0100 Subject: [PATCH 044/273] mod/notification-email: $SendEMail: use $ExitError to indicate unintentional error --- mod/notification-email.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index ff4188c..e51779b 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -226,11 +226,13 @@ } # send notification via e-mail - expects at least two string arguments -:set SendEMail do={ +:set SendEMail do={ :do { :global SendEMail2; $SendEMail2 ({ origin=$0; subject=$1; message=$2; link=$3 }); -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via e-mail - expects one array argument :set SendEMail2 do={ From 81f59f9894cfd9b29a2366e8a13e124b358dadde Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 045/273] packages-update: use $ExitError to indicate unintentional error --- packages-update.rsc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages-update.rsc b/packages-update.rsc index b08a48d..924a5d9 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -45,6 +46,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -52,11 +54,13 @@ :if ([ :typeof ($Update->"latest-version") ] = "nothing") do={ $LogPrint warning $ScriptName ("Latest version is not known."); + :set ExitOK true; :error false; } :if ($Update->"installed-version" = $Update->"latest-version") do={ $LogPrint info $ScriptName ("Version " . $Update->"latest-version" . " is already installed."); + :set ExitOK true; :error true; } @@ -85,10 +89,12 @@ $LogPrint info $ScriptName ("User requested to continue anyway."); } else={ $LogPrint info $ScriptName ("Canceled update..."); + :set ExitOK true; :error false; } } else={ $LogPrint warning $ScriptName ("Canceled non-interactive update."); + :set ExitOK true; :error false; } } @@ -108,6 +114,7 @@ } } else={ $LogPrint warning $ScriptName ("Not installing downgrade automatically."); + :set ExitOK true; :error false; } } @@ -116,6 +123,7 @@ :local PkgName [ /system/package/get $Package name ]; :if ([ $DownloadPackage $PkgName ($Update->"latest-version") ] = false) do={ $LogPrint error $ScriptName ("Download for package " . $PkgName . " failed, update aborted."); + :set ExitOK true; :error false; } } @@ -130,11 +138,13 @@ :put "Do you want to (s)chedule reboot or (r)eboot now? [s/R]"; :if (([ /terminal/inkey timeout=60 ] % 32) = 19) do={ $Schedule $ScriptName; + :set ExitOK true; :error true; } } else={ :if ($PackagesUpdateDeferReboot = true) do={ $Schedule $ScriptName; + :set ExitOK true; :error true; } } @@ -142,4 +152,6 @@ $LogPrint info $ScriptName ("Rebooting for update."); :delay 1s; /system/reboot; -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 1994b23e462c02ee71d5cb9db21d0e6075010c3c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 08:56:35 +0100 Subject: [PATCH 046/273] mod/notification-matrix: $FlushMatrixQueue: use $ExitError to indicate unintentional error --- mod/notification-matrix.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 3adc1df..751967c 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -18,7 +18,7 @@ :global SetupMatrixJoinRoom; # flush Matrix queue -:set FlushMatrixQueue do={ +:set FlushMatrixQueue do={ :do { :global MatrixQueue; :global IsFullyConnected; @@ -57,7 +57,9 @@ /system/scheduler/remove [ find where name="_FlushMatrixQueue" ]; :set MatrixQueue; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via Matrix - expects one array argument :set ($NotificationFunctions->"matrix") do={ From be0548007184bae80dd40b4a6390ababeeb39617 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 047/273] ppp-on-up: use $ExitError to indicate unintentional error --- ppp-on-up.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc index 337b32d..13b42c7 100644 --- a/ppp-on-up.rsc +++ b/ppp-on-up.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -20,6 +21,7 @@ :if ([ :typeof $Interface ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook."); + :set ExitOK true; :error false; } @@ -37,4 +39,6 @@ $LogPrint warning $ScriptName ("Running script '" . $ScriptName . "' failed!"); } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From de9dee83bea855a893594e0d58ca609872f75072 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 11:10:03 +0100 Subject: [PATCH 048/273] mod/notification-matrix: $SendMatrix: use $ExitError to indicate unintentional error --- mod/notification-matrix.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 751967c..14f369d 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -166,11 +166,13 @@ } # send notification via Matrix - expects at least two string arguments -:set SendMatrix do={ +:set SendMatrix do={ :do { :global SendMatrix2; $SendMatrix2 ({ origin=$0; subject=$1; message=$2; link=$3 }); -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via Matrix - expects one array argument :set SendMatrix2 do={ From ede351f47e8311fe00bada723e69ab90dc1332d0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 049/273] sms-action: use $ExitError to indicate unintentional error --- sms-action.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sms-action.rsc b/sms-action.rsc index c896659..fd3096c 100644 --- a/sms-action.rsc +++ b/sms-action.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -23,6 +24,7 @@ :if ([ :typeof $Action ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from SMS hook with action=..."); + :set ExitOK true; :error false; } @@ -34,4 +36,6 @@ } else={ $LogPrint warning $ScriptName ("The code for action '" . $Action . "' failed syntax validation!"); } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From aac723e2a1eede3649c5f3b4bbe67af0e951063a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 08:57:01 +0100 Subject: [PATCH 050/273] mod/notification-ntfy: $FlushNtfyQueue: use $ExitError to indicate unintentional error --- mod/notification-ntfy.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index b2bb280..5fdeedf 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -15,7 +15,7 @@ :global SendNtfy2; # flush ntfy queue -:set FlushNtfyQueue do={ +:set FlushNtfyQueue do={ :do { :global NtfyQueue; :global NtfyMessageIDs; @@ -52,7 +52,9 @@ /system/scheduler/remove [ find where name="_FlushNtfyQueue" ]; :set NtfyQueue; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via ntfy - expects one array argument :set ($NotificationFunctions->"ntfy") do={ From a78fe98fd0746dd88429413d9c81123866d880bd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 051/273] sms-forward: use $ExitError to indicate unintentional error --- sms-forward.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sms-forward.rsc b/sms-forward.rsc index 0d493b6..8334d5f 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -28,11 +29,13 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ /tool/sms/get receive-enabled ] = false) do={ $LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled."); + :set ExitOK true; :error false; } @@ -42,6 +45,7 @@ :if ([ /interface/lte/get ($Settings->"port") running ] != true) do={ $LogPrint info $ScriptName ("The LTE interface is not in running state, skipping."); + :set ExitOK true; :error true; } @@ -92,4 +96,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From e76ae11b029169e971f7313b17d5c43589fa8170 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 11:10:24 +0100 Subject: [PATCH 052/273] mod/notification-ntfy: $SendNtfy: use $ExitError to indicate unintentional error --- mod/notification-ntfy.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 5fdeedf..7e0234b 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -134,11 +134,13 @@ } # send notification via ntfy - expects at least two string arguments -:set SendNtfy do={ +:set SendNtfy do={ :do { :global SendNtfy2; $SendNtfy2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via ntfy - expects one array argument :set SendNtfy2 do={ From adbefca0e48bda15d90cc53c52c3982230f8864c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 053/273] telegram-chat: use $ExitError to indicate unintentional error --- telegram-chat.rsc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index f2750f5..8589aab 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -11,6 +11,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -43,6 +44,7 @@ :global WaitFullyConnected; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -57,6 +59,7 @@ :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ $LogPrint warning $ScriptName ("Downloading required certificate failed."); + :set ExitOK true; :error false; } @@ -82,6 +85,7 @@ :if ($Data = false) do={ $LogPrint warning $ScriptName ("Failed getting updates."); + :set ExitOK true; :error false; } @@ -130,6 +134,7 @@ :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]); :if ([ $MkDir "tmpfs/telegram-chat" ] = false) do={ $LogPrint error $ScriptName ("Failed creating directory!"); + :set ExitOK true; :error false; } $LogPrint info $ScriptName ("Running command from update " . $UpdateID . ": " . $Command); @@ -176,4 +181,6 @@ } :set TelegramChatOffset ([ :pick $TelegramChatOffset 1 3 ], \ [ $IfThenElse ($UpdateID >= $TelegramChatOffset->2) ($UpdateID + 1) ($TelegramChatOffset->2) ]); -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From e89867be1533cd561bf61b65f3019946e2ceeee1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 08:57:20 +0100 Subject: [PATCH 054/273] mod/notification-telegram: $FlushTelegramQueue: use $ExitError to indicate unintentional error --- mod/notification-telegram.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 671bd1c..993782d 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -15,7 +15,7 @@ :global SendTelegram2; # flush telegram queue -:set FlushTelegramQueue do={ +:set FlushTelegramQueue do={ :do { :global TelegramQueue; :global TelegramMessageIDs; @@ -56,7 +56,9 @@ /system/scheduler/remove [ find where name="_FlushTelegramQueue" ]; :set TelegramQueue; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via telegram - expects one array argument :set ($NotificationFunctions->"telegram") do={ From d4ea0e18a710c5a68c7dabaa5c1c5a40568c965b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 055/273] update-gre-address: use $ExitError to indicate unintentional error --- update-gre-address.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update-gre-address.rsc b/update-gre-address.rsc index 6dd829d..87762d6 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -12,6 +12,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -20,6 +21,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -39,4 +41,6 @@ } } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 4968b79fc1142c9bfdbfe93c8f917cfdd7f51790 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 11:10:43 +0100 Subject: [PATCH 056/273] mod/notification-telegram: $SendTelegram: use $ExitError to indicate unintentional error --- mod/notification-telegram.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 993782d..7d75b8b 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -182,11 +182,13 @@ } # send notification via telegram - expects at least two string arguments -:set SendTelegram do={ +:set SendTelegram do={ :do { :global SendTelegram2; $SendTelegram2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # send notification via telegram - expects one array argument :set SendTelegram2 do={ From ee030740cba5bd0c8b0c9c3e77551dd460abe48b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: [PATCH 057/273] update-tunnelbroker: use $ExitError to indicate unintentional error --- update-tunnelbroker.rsc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index 67a5d30..dd43c64 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -13,6 +13,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -22,11 +23,13 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } :if ([ $CertificateAvailable "Starfield Root Certificate Authority - G2" ] = false) do={ $LogPrint error $ScriptName ("Downloading required certificate failed."); + :set ExitOK true; :error false; } @@ -50,6 +53,7 @@ :if (!($Data ~ "^(good|nochg) ")) do={ $LogPrint error $ScriptName ("Failed sending the local address to tunnelbroker or unexpected response!"); + :set ExitOK true; :error false; } @@ -64,4 +68,6 @@ /interface/6to4/set $Interface local-address=$PublicAddress; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} From 48bcf8ee6e92445b01f792f1c52af012ba05b7b4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:45:30 +0100 Subject: [PATCH 058/273] =?UTF-8?q?global-functions:=20$FetchHuge:=20passi?= =?UTF-8?q?ng=20boolean=20to=20function=20is=20still=20broken...=20?= =?UTF-8?q?=F0=9F=A4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global-functions.rsc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 47a69c4..6fec6dd 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -427,9 +427,9 @@ # fetch huge data to file, read in chunks :set FetchHuge do={ - :local ScriptName [ :tostr $1 ]; - :local Url [ :tostr $2 ]; - :local CheckCert [ :tobool $3 ]; + :local ScriptName [ :tostr $1 ]; + :local Url [ :tostr $2 ]; + :local CheckCert [ :tostr $3 ]; :global CleanName; :global FetchUserAgentStr; @@ -439,7 +439,7 @@ :global MkDir; :global WaitForFile; - :set CheckCert [ $IfThenElse ($CheckCert = false) "no" "yes-without-crl" ]; + :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ]; :local DirName ("tmpfs/" . [ $CleanName $ScriptName ]); :if ([ $MkDir $DirName ] = false) do={ From 73e0ac75f10019794a2692371ca08a46bea69eb9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:10:44 +0100 Subject: [PATCH 059/273] mod/scriptrunonce: $ScriptRunOnce: use $ExitError to indicate unintentional error --- mod/scriptrunonce.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index 3d5dce9..c8dcf26 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -11,7 +11,7 @@ :global ScriptRunOnce; # fetch and run script(s) once -:set ScriptRunOnce do={ +:set ScriptRunOnce do={ :do { :local Scripts [ :toarray $1 ]; :global ScriptRunOnceBaseUrl; @@ -49,4 +49,6 @@ } } } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } From 1788c0599865ee9cb7e5015e260d7e4a49abf581 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:11:39 +0100 Subject: [PATCH 060/273] mod/ssh-keys-import: $SSHKeysImport: use $ExitError to indicate unintentional error --- mod/ssh-keys-import.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index c7b2788..b2f1d20 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -12,7 +12,7 @@ :global SSHKeysImportFile; # import single key passed as string -:set SSHKeysImport do={ +:set SSHKeysImport do={ :do { :local Key [ :tostr $1 ]; :local User [ :tostr $2 ]; @@ -64,7 +64,9 @@ /file/remove "tmpfs/ssh-keys-import"; :return false; } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } # import keys from a file :set SSHKeysImportFile do={ From f8a55860afaf8817e52cb89add227fa9a84435f0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 8 Dec 2024 22:19:01 +0100 Subject: [PATCH 061/273] check-routeros-update: pass script name to local function --- check-routeros-update.rsc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 510acd9..a2e39b6 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -35,6 +35,8 @@ :global WaitFullyConnected; :local DoUpdate do={ + :local ScriptName [ :tostr $1 ]; + :global LogPrint; :if ([ :len [ /system/script/find where name="packages-update" ] ] > 0) do={ @@ -42,7 +44,7 @@ } else={ /system/package/update/install without-paging; } - $LogPrint info $0 ("Waiting for system to reboot."); + $LogPrint info $ScriptName ("Waiting for system to reboot."); } :if ([ $ScriptLock $ScriptName ] = false) do={ @@ -95,7 +97,7 @@ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \ message=("Installing ALL versions automatically, including " . $Update->"latest-version" . \ "... Updating on " . $Identity . "..."); link=$Link; silent=true }); - $DoUpdate; + $DoUpdate $ScriptName; :set ExitOK true; :error true; } @@ -106,7 +108,7 @@ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \ message=("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); - $DoUpdate; + $DoUpdate $ScriptName; :set ExitOK true; :error true; } @@ -122,7 +124,7 @@ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \ message=("Seen a neighbor (" . $Neighbor . ") running version " . $Update->"latest-version" . \ " from " . $Update->"channel" . ", updating on " . $Identity . "..."); link=$Link; silent=true }); - $DoUpdate; + $DoUpdate $ScriptName; :set ExitOK true; :error true; } @@ -144,7 +146,7 @@ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \ message=("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); - $DoUpdate; + $DoUpdate $ScriptName; :set ExitOK true; :error true; } @@ -163,7 +165,7 @@ :put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]"); :if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={ - $DoUpdate; + $DoUpdate $ScriptName; :set ExitOK true; :error true; } else={ From 210ef26b93364f4b69cde9ff34139d51572357ee Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 9 Dec 2024 09:11:56 +0100 Subject: [PATCH 062/273] mod/ssh-keys-import: $SSHKeysImportFile: use $ExitError to indicate unintentional error --- mod/ssh-keys-import.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index b2f1d20..583e827 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -69,7 +69,7 @@ } } # import keys from a file -:set SSHKeysImportFile do={ +:set SSHKeysImportFile do={ :do { :local FileName [ :tostr $1 ]; :local User [ :tostr $2 ]; @@ -108,4 +108,6 @@ $LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported."); } } -} +} on-error={ + :global ExitError; $ExitError false $0; +} } From e51191035b21c529efb4387dfe59976c3112f561 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 8 Dec 2024 22:22:18 +0100 Subject: [PATCH 063/273] mode-button: $ModeButtonScheduler: explicitly name the variable --- mode-button.rsc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mode-button.rsc b/mode-button.rsc index 24de453..2d428ed 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -26,6 +26,8 @@ :if ([ :len $Scheduler ] = 0) do={ $LogPrint info $ScriptName ("Creating scheduler _ModeButtonScheduler, counting presses..."); :global ModeButtonScheduler do={ + :local FuncName $0; + :global ModeButton; :global LogPrint; @@ -54,7 +56,7 @@ :if ([ :len $Code ] > 0) do={ :if ([ $ValidateSyntax $Code ] = true) do={ - $LogPrint info $0 ("Acting on " . $Count . " mode-button presses: " . $Code); + $LogPrint info $FuncName ("Acting on " . $Count . " mode-button presses: " . $Code); :for I from=1 to=$Count do={ $LEDInvert; @@ -69,13 +71,15 @@ :do { [ :parse $Code ]; } on-error={ - $LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed with runtime error!"); + $LogPrint warning $FuncName \ + ("The code for " . $Count . " mode-button presses failed with runtime error!"); } } else={ - $LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed syntax validation!"); + $LogPrint warning $FuncName \ + ("The code for " . $Count . " mode-button presses failed syntax validation!"); } } else={ - $LogPrint info $0 ("No action defined for " . $Count . " mode-button presses."); + $LogPrint info $FuncName ("No action defined for " . $Count . " mode-button presses."); } } /system/scheduler/add name="_ModeButtonScheduler" \ From bceabebf9c6c30e2b1057448d74a5de006ef5d1e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 Dec 2024 17:05:12 +0100 Subject: [PATCH 064/273] mod/notification-email: drop useless safeguard Guess it was useful back in the day. Now the function exits early if the queue is empty... So this can never be zero. --- mod/notification-email.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index e51779b..dd90923 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -71,7 +71,7 @@ $LogPrint warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty."); } - /system/scheduler/set interval=([ $EitherOr $QueueLen 1 ] . "m") comment="Sending..." $Scheduler; + /system/scheduler/set interval=($QueueLen . "m") comment="Sending..." $Scheduler; :foreach Id,Message in=$EmailQueue do={ :if ([ :typeof $Message ] = "array" ) do={ From 42bcc63d29c85a7fcdb175b3ea725654d2db7039 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 Dec 2024 17:12:24 +0100 Subject: [PATCH 065/273] mod/notification-email: increase retry interval on failure --- mod/notification-email.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index dd90923..b109bf4 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -46,8 +46,9 @@ :local AllDone true; :local QueueLen [ :len $EmailQueue ]; :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; + :local SchedVal [ /system/scheduler/get $Scheduler ]; - :if ([ :len $Scheduler ] > 0 && [ /system/scheduler/get $Scheduler interval ] < 1m) do={ + :if ([ :len $Scheduler ] > 0 && ($SchedVal->"interval") < 1m) do={ /system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler; } @@ -111,7 +112,8 @@ /system/scheduler/remove $Scheduler; :set EmailQueue; } else={ - /system/scheduler/set interval=1m comment="Waiting for retry..." $Scheduler; + /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ + comment="Waiting for retry..." $Scheduler; } } on-error={ :global ExitError; $ExitError false $0; From c311e58d998fabc7568acd77f0a8bd42468f50b0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 Dec 2024 20:23:26 +0100 Subject: [PATCH 066/273] leds-toggle-mode: toggle in one call... ... and drop the condition. --- leds-toggle-mode.rsc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/leds-toggle-mode.rsc b/leds-toggle-mode.rsc index 136c9d1..07e12ae 100644 --- a/leds-toggle-mode.rsc +++ b/leds-toggle-mode.rsc @@ -6,8 +6,4 @@ # toggle LEDs mode # https://git.eworm.de/cgit/routeros-scripts/about/doc/leds-mode.md -:if ([ /system/leds/settings/get all-leds-off ] = "never") do={ - /system/leds/settings/set all-leds-off=immediate; -} else={ - /system/leds/settings/set all-leds-off=never; -} +/system/leds/settings/set all-leds-off=(({ "never"="immediate"; "immediate"="never" })->[ get all-leds-off ]); From d70efe910ae3a9bef3ee6b62c0fd6d591bab89e3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 Dec 2024 20:32:50 +0100 Subject: [PATCH 067/273] mode-button: support led toggle without extra script --- global-config.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global-config.rsc b/global-config.rsc index 2ed67f3..5292853 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -186,7 +186,7 @@ # Run different commands with multiple mode-button presses. :global ModeButton { - 1="/system/script/run leds-toggle-mode;"; + 1="/system/leds/settings/set all-leds-off=(({ \"never\"=\"immediate\"; \"immediate\"=\"never\" })->[ get all-leds-off ]);"; 2=":global Identity; :global SendNotification; :global SymbolForNotification; \$SendNotification ([ \$SymbolForNotification \"earth\" ] . \"Hello...\") (\"Hello world, \" . \$Identity . \" calling!\");"; 3="/system/shutdown;"; 4="/system/reboot;"; From 8231c3e833ee83a118f4d8395c097e6a9f312c2f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 10:40:06 +0100 Subject: [PATCH 068/273] global-functions: $WaitForFile: delay until "complete"... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Well, turns out that waiting for existence of a file is not sufficient. Chances are that a file is available just partly, so wait until the size no longer changes... Let's hope that works as expected. 🤞 --- global-functions.rsc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 625f8cd..e5e5d50 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1577,6 +1577,16 @@ :delay $Delay; :set I ($I + 1); } + + :local File [ /file/find where name=$FileName ]; + :local SizeA 0; + :local SizeB 1; + :while ($SizeA < $SizeB) do={ + :set SizeA $SizeB; + :delay $Delay; + :set SizeB [ /file/get $File size ]; + } + :return true; } From 009a6bd76204083f4b1971b285d90e916c0fbc29 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 10:55:23 +0100 Subject: [PATCH 069/273] mod/notification-email: $FlushEmailQueue: return on success --- mod/notification-email.rsc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index b109bf4..1d9a0a1 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -111,10 +111,11 @@ :if ($AllDone = true && $QueueLen = [ :len $EmailQueue ]) do={ /system/scheduler/remove $Scheduler; :set EmailQueue; - } else={ - /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ - comment="Waiting for retry..." $Scheduler; + :return true; } + + /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ + comment="Waiting for retry..." $Scheduler; } on-error={ :global ExitError; $ExitError false $0; } } From 53106731528adc607ee40336b79c516fac594a17 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 10:59:37 +0100 Subject: [PATCH 070/273] mod/notification-email: $FlushEmailQueue: return on purge --- mod/notification-email.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 1d9a0a1..60c1e9b 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -114,6 +114,12 @@ :return true; } + :if ([ :len [ /system/scheduler/find where name="_FlushEmailQueue" ] ] = 0 && \ + [ :typeof $EmailQueue ] = "nothing") do={ + $LogPrint info $0 ("Queue was purged? Exiting."); + :return false; + } + /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ comment="Waiting for retry..." $Scheduler; } on-error={ From 1e2ca3d21441ac7881b7c556c8d73c70bb92edc6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 11:28:12 +0100 Subject: [PATCH 071/273] mod/notification-email: $FlushEmailQueue: create scheduler if missing... ... as it is required to be modified several times below. --- mod/notification-email.rsc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 60c1e9b..c474750 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -46,9 +46,15 @@ :local AllDone true; :local QueueLen [ :len $EmailQueue ]; :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; - :local SchedVal [ /system/scheduler/get $Scheduler ]; - :if ([ :len $Scheduler ] > 0 && ($SchedVal->"interval") < 1m) do={ + :if ([ :len $Scheduler ] < 0) do={ + /system/scheduler/add name="_FlushEmailQueue" interval=1m start-time=startup \ + comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); + :set Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; + } + + :local SchedVal [ /system/scheduler/get $Scheduler ]; + :if (($SchedVal->"interval") < 1m) do={ /system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler; } From 8c8c75ca66d59d9368fe3f4fe7f1124a425f41b3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 11:51:17 +0100 Subject: [PATCH 072/273] mod/notification-email: $FlushEmailQueue: move the check up... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as this needs to be done before creating a scheduler. 😜 Also remove the scheduler and return. --- mod/notification-email.rsc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index c474750..bbce6d0 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -47,6 +47,12 @@ :local QueueLen [ :len $EmailQueue ]; :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; + :if ([ :len $Scheduler ] > 0 && $QueueLen = 0) do={ + $LogPrint warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty."); + /system/scheduler/remove $Scheduler; + :return false; + } + :if ([ :len $Scheduler ] < 0) do={ /system/scheduler/add name="_FlushEmailQueue" interval=1m start-time=startup \ comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); @@ -74,10 +80,6 @@ :return false; } - :if ([ :len $Scheduler ] > 0 && $QueueLen = 0) do={ - $LogPrint warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty."); - } - /system/scheduler/set interval=($QueueLen . "m") comment="Sending..." $Scheduler; :foreach Id,Message in=$EmailQueue do={ From b66332eb464884d69eef56aa5ecb7ae74d1914cc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 11:58:41 +0100 Subject: [PATCH 073/273] mod/notification-email: $FlushEmailQueue: just return on empty queue --- mod/notification-email.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index bbce6d0..a3291d9 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -53,6 +53,10 @@ :return false; } + :if ($QueueLen = 0) do={ + :return true; + } + :if ([ :len $Scheduler ] < 0) do={ /system/scheduler/add name="_FlushEmailQueue" interval=1m start-time=startup \ comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); From a7878d664f51ed77a574a5d360c9c53863d0d488 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 11 Dec 2024 12:11:15 +0100 Subject: [PATCH 074/273] fw-addr-lists: do not fail on invalid json data --- fw-addr-lists.rsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 6682f4a..a195c89 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -92,7 +92,9 @@ :set Line ($Line->0); :local Address; :if ([ :pick $Line 0 1 ] = "{") do={ - :set Address [ :tostr ([ :deserialize from=json $Line ]->"cidr") ]; + :do { + :set Address [ :tostr ([ :deserialize from=json $Line ]->"cidr") ]; + } on-error={ } } else={ :set Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr")); } From d1b9b1b410933e0510845c245f742a7df172dc61 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 13 Dec 2024 17:40:49 +0100 Subject: [PATCH 075/273] mod/notification-ntfy: support authentication with bearer token Closes: https://github.com/eworm-de/routeros-scripts/issues/86 --- doc/mod/notification-ntfy.md | 2 ++ global-config.rsc | 1 + mod/notification-ntfy.rsc | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/doc/mod/notification-ntfy.md b/doc/mod/notification-ntfy.md index 5393d44..04dee35 100644 --- a/doc/mod/notification-ntfy.md +++ b/doc/mod/notification-ntfy.md @@ -52,6 +52,8 @@ basic authentication. Configure `NtfyServerUser` and `NtfyServerPass` for this. Even authentication via access token is possible, adding it as password with a blank username. +Also available is `NtfyServerToken` to add a bearer token for authentication. + For a custom service installing an additional certificate may be required. You may want to install that certificate manually, after finding the [certificate name from browser](../../CERTIFICATES.md). diff --git a/global-config.rsc b/global-config.rsc index 5292853..0c8f738 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -58,6 +58,7 @@ :global NtfyServer "ntfy.sh"; :global NtfyServerUser []; :global NtfyServerPass []; +:global NtfyServerToken []; :global NtfyTopic ""; # It is possible to override e-mail, Telegram, Matrix and Ntfy setting diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 7e0234b..7e4eaf0 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -67,6 +67,8 @@ :global NtfyServerOverride; :global NtfyServerPass; :global NtfyServerPassOverride; + :global NtfyServerToken; + :global NtfyServerTokenOverride; :global NtfyServerUser; :global NtfyServerUserOverride; :global NtfyTopic; @@ -83,6 +85,7 @@ :local Server [ $EitherOr ($NtfyServerOverride->($Notification->"origin")) $NtfyServer ]; :local User [ $EitherOr ($NtfyServerUserOverride->($Notification->"origin")) $NtfyServerUser ]; :local Pass [ $EitherOr ($NtfyServerPassOverride->($Notification->"origin")) $NtfyServerPass ]; + :local Token [ $EitherOr ($NtfyServerTokenOverride->($Notification->"origin")) $NtfyServerToken ]; :local Topic [ $EitherOr ($NtfyTopicOverride->($Notification->"origin")) $NtfyTopic ]; :if ([ :len $Topic ] = 0) do={ @@ -93,6 +96,9 @@ :local Headers ({ [ $FetchUserAgentStr ($Notification->"origin") ]; \ ("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \ ("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) }); + :if ([ :len $Token ] > 0) do={ + :set Headers ($Headers, ("Authorization: Bearer " . $Token)); + } :local Text (($Notification->"message") . "\n"); :if ([ :len ($Notification->"link") ] > 0) do={ :set Text ($Text . "\n" . [ $SymbolForNotification "link" ] . ($Notification->"link")); From 6bee4675509e874d2f2ed8ee960f251b5667a451 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 13 Dec 2024 17:48:49 +0100 Subject: [PATCH 076/273] mod/notification-ntfy: add basic authentication in headers This makes it a bit easier and straight forward as we pass the headers anyway. --- mod/notification-ntfy.rsc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 7e4eaf0..f8351fd 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -39,7 +39,7 @@ :do { /tool/fetch check-certificate=yes-without-crl output=none http-method=post \ http-header-field=($Message->"headers") http-data=($Message->"text") \ - ($Message->"url") user=($Message->"user") password=($Message->"pass") as-value; + ($Message->"url") as-value; :set ($NtfyQueue->$Id); } on-error={ $LogPrint debug $0 ("Sending queued Ntfy message failed."); @@ -96,6 +96,9 @@ :local Headers ({ [ $FetchUserAgentStr ($Notification->"origin") ]; \ ("Priority: " . [ $IfThenElse ($Notification->"silent") "low" "default" ]); \ ("Title: " . "[" . $IdentityExtra . $Identity . "] " . ($Notification->"subject")) }); + :if ([ :len $User ] > 0 || [ :len $Pass ] > 0) do={ + :set Headers ($Headers, ("Authorization: Basic " . [ :convert to=base64 ($User . ":" . $Pass) ])); + } :if ([ :len $Token ] > 0) do={ :set Headers ($Headers, ("Authorization: Bearer " . $Token)); } @@ -112,7 +115,7 @@ } } /tool/fetch check-certificate=yes-without-crl output=none http-method=post \ - http-header-field=$Headers http-data=$Text $Url user=$User password=$Pass as-value; + http-header-field=$Headers http-data=$Text $Url as-value; } on-error={ $LogPrint info $0 ("Failed sending ntfy notification! Queuing..."); @@ -123,7 +126,7 @@ "This message was queued since " . [ /system/clock/get date ] . " " . \ [ /system/clock/get time ] . " and may be obsolete."); :set ($NtfyQueue->[ :len $NtfyQueue ]) \ - { url=$Url; user=$User; pass=$Pass; headers=$Headers; text=$Text }; + { url=$Url; headers=$Headers; text=$Text }; :if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] = 0) do={ /system/scheduler/add name="_FlushNtfyQueue" interval=1m start-time=startup \ on-event=(":global FlushNtfyQueue; \$FlushNtfyQueue;"); From ba39c29648282159082dfa999ec40c7fc84b0e3c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 25 Dec 2024 21:47:23 +0100 Subject: [PATCH 077/273] global-functions: $ParseKeyValueStore: split key and value... ... into separate variables. --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index e5e5d50..b212d3a 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -925,8 +925,9 @@ :local Result ({}); :foreach KeyValue in=[ :toarray $Source ] do={ :if ([ :find $KeyValue "=" ]) do={ - :set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \ - [ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ]; + :local Key [ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]; + :local Value [ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ]; + :set ($Result->$Key) $Value; } else={ :set ($Result->$KeyValue) true; } From 8212bd6c95935f02335d7d774bd3115a2c071fb1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 25 Dec 2024 21:56:45 +0100 Subject: [PATCH 078/273] global-functions: $ParseKeyValueStore: properly return boolean values --- global-functions.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index b212d3a..766e8a2 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -927,6 +927,8 @@ :if ([ :find $KeyValue "=" ]) do={ :local Key [ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]; :local Value [ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ]; + :if ($Value="true") do={ :set Value true; } + :if ($Value="false") do={ :set Value false; } :set ($Result->$Key) $Value; } else={ :set ($Result->$KeyValue) true; From ef3ce7cc6c43b28e6a80345d9861775767ba86f4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 25 Dec 2024 22:22:30 +0100 Subject: [PATCH 079/273] global-functions: $ParseKeyValueStore: support JSON as input This used to require a key=value store, separated with commas. An example for `netwatch-notify` is: /tool/netwatch/add comment="notify, name=example.com" host=93.184.215.14; Now JSON is supported as well, so you could use: /tool/netwatch/add comment="{\"notify\":true,\"name\":\"example.com\"}" host=93.184.215.14; Looks more clumsy here, but may be of help in more complex setups... --- global-functions.rsc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 766e8a2..85818b4 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -919,6 +919,13 @@ # parse key value store :set ParseKeyValueStore do={ :local Source $1; + + :if ([ :pick $Source 0 1 ] = "{") do={ + :do { + :return [ :deserialize from=json $Source ]; + } on-error={ } + } + :if ([ :typeof $Source ] != "array") do={ :set Source [ :tostr $1 ]; } From 3ada3055fff08e655864f4e8e07f060b73077394 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 30 Dec 2024 19:51:42 +0100 Subject: [PATCH 080/273] fw-addr-lists: spamhaus.org returned to 'ISRG Root X1' This reverts commit 4d8dce97691ad090091574a790449a7bd564023c. --- certs/Makefile | 2 +- global-config.rsc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/certs/Makefile b/certs/Makefile index 870cb54..9ce8dd4 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -22,7 +22,7 @@ DOMAINS = \ sslbl.abuse.ch/GlobalSign \ upgrade.mikrotik.com/ISRG-Root-X1 \ www.dshield.org/ISRG-Root-X1 \ - www.spamhaus.org/GTS-Root-R4 + www.spamhaus.org/ISRG-Root-X1 .PHONY: $(DOMAINS) diff --git a/global-config.rsc b/global-config.rsc index 0c8f738..cd41a9c 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -107,9 +107,9 @@ { url="https://lists.blocklist.de/lists/strongips.txt"; cert="Certum Trusted Network CA" }; # { url="https://www.spamhaus.org/drop/drop_v4.json"; -# cert="GTS Root R4" }; +# cert="ISRG Root X1" }; # { url="https://www.spamhaus.org/drop/drop_v6.json"; -# cert="GTS Root R4" }; +# cert="ISRG Root X1" }; }; # "mikrotik"={ # { url="https://git.eworm.de/cgit/routeros-scripts/plain/fw-addr-lists.d/mikrotik"; From 191cc1b952b469c474b0181ebdee0ccfd47ae75b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 30 Dec 2024 20:09:46 +0100 Subject: [PATCH 081/273] global-functions: $FetchHuge: another workaround for complete file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turns out the workaround in $WaitForFile (commit 8231c3e833ee83a118f4d8395c097e6a9f312c2f) is not sufficient. It helps sometimes, but not always. Possibly depends on CPU speed and bandwidth of internet connection... Who knows!? đŸ¤Ē But! Reading the file goes beyond the known file size. That's suspicious and indicates this exact issue. So add a delay, and keep reading until sizes are equal. --- global-functions.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 85818b4..a59eca1 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -479,9 +479,13 @@ :local FileSize [ /file/get $FileName size ]; :local Return ""; :local VarSize 0; - :while ($VarSize < $FileSize) do={ + :while ($VarSize != $FileSize) do={ :set Return ($Return . ([ /file/read offset=$VarSize chunk-size=32768 file=$FileName as-value ]->"data")); + :set FileSize [ /file/get $FileName size ]; :set VarSize [ :len $Return ]; + :if ($VarSize > $FileSize) do={ + :delay 100ms; + } } /file/remove $DirName; :return $Return; From b98b2457140701261b299af0a2d742bf6aa2b9bc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 30 Dec 2024 20:22:51 +0100 Subject: [PATCH 082/273] global-functions: $WaitForFile: drop the first workaround This reverts commit 8231c3e833ee83a118f4d8395c097e6a9f312c2f. Truned out this workaround was not sufficient, see the follow-up in commit 191cc1b952b469c474b0181ebdee0ccfd47ae75b for details. But possibly the second one does it on its own? Reverting this for a test run. --- global-functions.rsc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index a59eca1..d5df5e7 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1591,16 +1591,6 @@ :delay $Delay; :set I ($I + 1); } - - :local File [ /file/find where name=$FileName ]; - :local SizeA 0; - :local SizeB 1; - :while ($SizeA < $SizeB) do={ - :set SizeA $SizeB; - :delay $Delay; - :set SizeB [ /file/get $File size ]; - } - :return true; } From 9e3729c27990a7ecbdc73694319b924ee00ba867 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 2 Jan 2025 00:04:06 +0100 Subject: [PATCH 083/273] update copyright for 2025 --- accesslist-duplicates.capsman.rsc | 2 +- accesslist-duplicates.local.rsc | 2 +- accesslist-duplicates.template.rsc | 2 +- accesslist-duplicates.wifi.rsc | 2 +- backup-cloud.rsc | 2 +- backup-email.rsc | 2 +- backup-partition.rsc | 2 +- backup-upload.rsc | 2 +- capsman-download-packages.capsman.rsc | 2 +- capsman-download-packages.template.rsc | 2 +- capsman-download-packages.wifi.rsc | 2 +- capsman-rolling-upgrade.capsman.rsc | 2 +- capsman-rolling-upgrade.template.rsc | 2 +- capsman-rolling-upgrade.wifi.rsc | 2 +- certificate-renew-issued.rsc | 2 +- check-certificates.rsc | 2 +- check-health.rsc | 2 +- check-lte-firmware-upgrade.rsc | 2 +- check-routeros-update.rsc | 2 +- collect-wireless-mac.capsman.rsc | 2 +- collect-wireless-mac.local.rsc | 2 +- collect-wireless-mac.template.rsc | 2 +- collect-wireless-mac.wifi.rsc | 2 +- daily-psk.capsman.rsc | 2 +- daily-psk.local.rsc | 2 +- daily-psk.template.rsc | 2 +- daily-psk.wifi.rsc | 2 +- dhcp-lease-comment.capsman.rsc | 2 +- dhcp-lease-comment.local.rsc | 2 +- dhcp-lease-comment.template.rsc | 2 +- dhcp-lease-comment.wifi.rsc | 2 +- dhcp-to-dns.rsc | 2 +- firmware-upgrade-reboot.rsc | 2 +- fw-addr-lists.rsc | 2 +- global-config-overlay.rsc | 2 +- global-config.rsc | 2 +- global-functions.rsc | 2 +- global-wait.rsc | 2 +- gps-track.rsc | 2 +- hotspot-to-wpa-cleanup.capsman.rsc | 2 +- hotspot-to-wpa-cleanup.template.rsc | 2 +- hotspot-to-wpa-cleanup.wifi.rsc | 2 +- hotspot-to-wpa.capsman.rsc | 2 +- hotspot-to-wpa.template.rsc | 2 +- hotspot-to-wpa.wifi.rsc | 2 +- ip-addr-bridge.rsc | 2 +- ipsec-to-dns.rsc | 2 +- ipv6-update.rsc | 2 +- lease-script.rsc | 2 +- leds-day-mode.rsc | 2 +- leds-night-mode.rsc | 2 +- leds-toggle-mode.rsc | 2 +- log-forward.rsc | 2 +- mod/bridge-port-to.rsc | 2 +- mod/bridge-port-vlan.rsc | 2 +- mod/inspectvar.rsc | 2 +- mod/ipcalc.rsc | 2 +- mod/notification-email.rsc | 2 +- mod/notification-matrix.rsc | 2 +- mod/notification-ntfy.rsc | 2 +- mod/notification-telegram.rsc | 2 +- mod/scriptrunonce.rsc | 2 +- mod/ssh-keys-import.rsc | 2 +- mode-button.rsc | 2 +- netwatch-dns.rsc | 2 +- netwatch-notify.rsc | 2 +- news-and-changes.rsc | 2 +- ospf-to-leds.rsc | 2 +- packages-update.rsc | 2 +- ppp-on-up.rsc | 2 +- sms-action.rsc | 2 +- sms-forward.rsc | 2 +- super-mario-theme.rsc | 2 +- telegram-chat.rsc | 2 +- unattended-lte-firmware-upgrade.rsc | 2 +- update-gre-address.rsc | 2 +- update-tunnelbroker.rsc | 2 +- 77 files changed, 77 insertions(+), 77 deletions(-) diff --git a/accesslist-duplicates.capsman.rsc b/accesslist-duplicates.capsman.rsc index ce0ce11..b611917 100644 --- a/accesslist-duplicates.capsman.rsc +++ b/accesslist-duplicates.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.capsman -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/accesslist-duplicates.local.rsc b/accesslist-duplicates.local.rsc index aa78fe8..ef0cf32 100644 --- a/accesslist-duplicates.local.rsc +++ b/accesslist-duplicates.local.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.local -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc index d0c282d..ab5b671 100644 --- a/accesslist-duplicates.template.rsc +++ b/accesslist-duplicates.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates%TEMPL% -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/accesslist-duplicates.wifi.rsc b/accesslist-duplicates.wifi.rsc index b1444e3..0205598 100644 --- a/accesslist-duplicates.wifi.rsc +++ b/accesslist-duplicates.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.wifi -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/backup-cloud.rsc b/backup-cloud.rsc index 4cc7a58..37ca92f 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: backup-cloud -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: backup-script, order=40 diff --git a/backup-email.rsc b/backup-email.rsc index e1d44ea..489927b 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: backup-email -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: backup-script, order=20 diff --git a/backup-partition.rsc b/backup-partition.rsc index f1e1c17..b2b75ac 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: backup-partition -# Copyright (c) 2022-2024 Christian Hesse +# Copyright (c) 2022-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: backup-script, order=70 diff --git a/backup-upload.rsc b/backup-upload.rsc index 12698e9..e050140 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: backup-upload -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: backup-script, order=50 diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index 1802884..4609498 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-download-packages.capsman -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 72edaa9..642a068 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-download-packages%TEMPL% -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 74a5d9d..1ea9b79 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-download-packages.wifi -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/capsman-rolling-upgrade.capsman.rsc b/capsman-rolling-upgrade.capsman.rsc index d0f9fb8..7a5ed81 100644 --- a/capsman-rolling-upgrade.capsman.rsc +++ b/capsman-rolling-upgrade.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-rolling-upgrade.capsman -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/capsman-rolling-upgrade.template.rsc b/capsman-rolling-upgrade.template.rsc index 1bd5f2a..fd7e31f 100644 --- a/capsman-rolling-upgrade.template.rsc +++ b/capsman-rolling-upgrade.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-rolling-upgrade%TEMPL% -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/capsman-rolling-upgrade.wifi.rsc b/capsman-rolling-upgrade.wifi.rsc index c9e6622..3fb99b8 100644 --- a/capsman-rolling-upgrade.wifi.rsc +++ b/capsman-rolling-upgrade.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: capsman-rolling-upgrade.wifi -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc index ce61f7d..32c3267 100644 --- a/certificate-renew-issued.rsc +++ b/certificate-renew-issued.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: certificate-renew-issued -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/check-certificates.rsc b/check-certificates.rsc index 52cfc5e..226364b 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: check-certificates -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/check-health.rsc b/check-health.rsc index 495b450..d3586db 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: check-health -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc index 898d6f1..cd9f979 100644 --- a/check-lte-firmware-upgrade.rsc +++ b/check-lte-firmware-upgrade.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: check-lte-firmware-upgrade -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index a2e39b6..c3d2625 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: check-routeros-update -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc index 77fd6e3..05e4b89 100644 --- a/collect-wireless-mac.capsman.rsc +++ b/collect-wireless-mac.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.capsman -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=40 diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc index dc7be19..67c1a98 100644 --- a/collect-wireless-mac.local.rsc +++ b/collect-wireless-mac.local.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.local -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=40 diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc index 34b1695..84a9667 100644 --- a/collect-wireless-mac.template.rsc +++ b/collect-wireless-mac.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac%TEMPL% -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=40 diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc index 23c93b0..fa4953b 100644 --- a/collect-wireless-mac.wifi.rsc +++ b/collect-wireless-mac.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.wifi -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=40 diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc index 263f6e5..f41da29 100644 --- a/daily-psk.capsman.rsc +++ b/daily-psk.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: daily-psk.capsman -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc index f0757e1..2920cb5 100644 --- a/daily-psk.local.rsc +++ b/daily-psk.local.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: daily-psk.local -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 7e36b5a..05c376e 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: daily-psk%TEMPL% -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/daily-psk.wifi.rsc b/daily-psk.wifi.rsc index 293f0e4..4182ab8 100644 --- a/daily-psk.wifi.rsc +++ b/daily-psk.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: daily-psk.wifi -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index 5ac0009..947181b 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.capsman -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=60 diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 1b74d93..27306dd 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.local -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=60 diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index 8f1ad47..8552b26 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment%TEMPL% -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=60 diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc index d3741c5..bf67bd0 100644 --- a/dhcp-lease-comment.wifi.rsc +++ b/dhcp-lease-comment.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.wifi -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=60 diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index ad55c4d..1eb832a 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: dhcp-to-dns -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=20 diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc index 9655903..f9e557c 100644 --- a/firmware-upgrade-reboot.rsc +++ b/firmware-upgrade-reboot.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: firmware-upgrade-reboot -# Copyright (c) 2022-2024 Christian Hesse +# Copyright (c) 2022-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index a195c89..e98a610 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: fw-addr-lists -# Copyright (c) 2023-2024 Christian Hesse +# Copyright (c) 2023-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.16 diff --git a/global-config-overlay.rsc b/global-config-overlay.rsc index 9ffd90c..227ae5a 100644 --- a/global-config-overlay.rsc +++ b/global-config-overlay.rsc @@ -1,5 +1,5 @@ # Overlay for global configuration by RouterOS Scripts -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # global configuration, custom overlay diff --git a/global-config.rsc b/global-config.rsc index cd41a9c..1f4e9ca 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: global-config -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # global configuration diff --git a/global-functions.rsc b/global-functions.rsc index d5df5e7..a2dd279 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: global-functions -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/global-wait.rsc b/global-wait.rsc index f0631e2..529dbd7 100644 --- a/global-wait.rsc +++ b/global-wait.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: global-wait -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/gps-track.rsc b/gps-track.rsc index c0ecac4..1bd976a 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: gps-track -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index 8a38213..1d27faf 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup.capsman -# Copyright (c) 2021-2024 Christian Hesse +# Copyright (c) 2021-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=80 diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index e8d2dfb..f92dbe5 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup%TEMPL% -# Copyright (c) 2021-2024 Christian Hesse +# Copyright (c) 2021-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=80 diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index e2ef1fd..cd21593 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup.wifi -# Copyright (c) 2021-2024 Christian Hesse +# Copyright (c) 2021-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # provides: lease-script, order=80 diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc index e57d327..d962ba7 100644 --- a/hotspot-to-wpa.capsman.rsc +++ b/hotspot-to-wpa.capsman.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa.capsman -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc index efe37d0..3438be7 100644 --- a/hotspot-to-wpa.template.rsc +++ b/hotspot-to-wpa.template.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa%TEMPL% -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc index 6242d04..a2bb3ca 100644 --- a/hotspot-to-wpa.wifi.rsc +++ b/hotspot-to-wpa.wifi.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa.wifi -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/ip-addr-bridge.rsc b/ip-addr-bridge.rsc index 758cd46..00b45a3 100644 --- a/ip-addr-bridge.rsc +++ b/ip-addr-bridge.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: ip-addr-bridge -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # enable or disable ip addresses based on bridge port state diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index 47676ca..39b21d5 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: ipsec-to-dns -# Copyright (c) 2021-2024 Christian Hesse +# Copyright (c) 2021-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/ipv6-update.rsc b/ipv6-update.rsc index ea1d444..a2fb831 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: ipv6-update -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/lease-script.rsc b/lease-script.rsc index 995c7e4..3d0fc72 100644 --- a/lease-script.rsc +++ b/lease-script.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: lease-script -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/leds-day-mode.rsc b/leds-day-mode.rsc index b7c6b5b..e0f08d6 100644 --- a/leds-day-mode.rsc +++ b/leds-day-mode.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: leds-day-mode -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # enable LEDs diff --git a/leds-night-mode.rsc b/leds-night-mode.rsc index fb7c7a2..1f50dfd 100644 --- a/leds-night-mode.rsc +++ b/leds-night-mode.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: leds-night-mode -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # disable LEDs diff --git a/leds-toggle-mode.rsc b/leds-toggle-mode.rsc index 07e12ae..55d5b82 100644 --- a/leds-toggle-mode.rsc +++ b/leds-toggle-mode.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: leds-toggle-mode -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # toggle LEDs mode diff --git a/log-forward.rsc b/log-forward.rsc index 8e660fc..8c2ebc0 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: log-forward -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc index 9e7b911..ec6f612 100644 --- a/mod/bridge-port-to.rsc +++ b/mod/bridge-port-to.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/bridge-port-to -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/bridge-port-vlan.rsc b/mod/bridge-port-vlan.rsc index 18fa2db..6221646 100644 --- a/mod/bridge-port-vlan.rsc +++ b/mod/bridge-port-vlan.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/bridge-port-vlan -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/inspectvar.rsc b/mod/inspectvar.rsc index 0209214..01724bb 100644 --- a/mod/inspectvar.rsc +++ b/mod/inspectvar.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/inspectvar -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/ipcalc.rsc b/mod/ipcalc.rsc index 021cd30..69dec8b 100644 --- a/mod/ipcalc.rsc +++ b/mod/ipcalc.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/ipcalc -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index a3291d9..6d700f5 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/notification-email -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 14f369d..aad8b42 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/notification-matrix -# Copyright (c) 2013-2024 Michael Gisbers +# Copyright (c) 2013-2025 Michael Gisbers # Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index f8351fd..53ba9b4 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/notification-ntfy -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 7d75b8b..f9700cf 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/notification-telegram -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index c8dcf26..7e01e72 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/scriptrunonece -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index 583e827..ad3a81e 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mod/ssh-keys-import -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.16 diff --git a/mode-button.rsc b/mode-button.rsc index 90fe80e..f8bd7b8 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: mode-button -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index a704c84..81f9d95 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: netwatch-dns -# Copyright (c) 2022-2024 Christian Hesse +# Copyright (c) 2022-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.16 diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index f1e87bd..e79977e 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: netwatch-notify -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.15 diff --git a/news-and-changes.rsc b/news-and-changes.rsc index 9ab811d..545a0c9 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -1,5 +1,5 @@ # News, changes and migration by RouterOS Scripts -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md :global IDonate; diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc index d96e763..3400e7f 100644 --- a/ospf-to-leds.rsc +++ b/ospf-to-leds.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: ospf-to-leds -# Copyright (c) 2020-2024 Christian Hesse +# Copyright (c) 2020-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/packages-update.rsc b/packages-update.rsc index 924a5d9..a79946d 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: packages-update -# Copyright (c) 2019-2024 Christian Hesse +# Copyright (c) 2019-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc index 13b42c7..a776ce2 100644 --- a/ppp-on-up.rsc +++ b/ppp-on-up.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: ppp-on-up -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/sms-action.rsc b/sms-action.rsc index fd3096c..f22a0bb 100644 --- a/sms-action.rsc +++ b/sms-action.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: sms-action -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/sms-forward.rsc b/sms-forward.rsc index 8334d5f..efebb75 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: sms-forward -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Anatoly Bubenkov # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # diff --git a/super-mario-theme.rsc b/super-mario-theme.rsc index 63308b0..fc868c8 100644 --- a/super-mario-theme.rsc +++ b/super-mario-theme.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: super-mario-theme -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # play Super Mario theme diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 8589aab..eebb617 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: telegram-chat -# Copyright (c) 2023-2024 Christian Hesse +# Copyright (c) 2023-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.15 diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc index 7ce4028..f1bc552 100644 --- a/unattended-lte-firmware-upgrade.rsc +++ b/unattended-lte-firmware-upgrade.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: unattended-lte-firmware-upgrade -# Copyright (c) 2018-2024 Christian Hesse +# Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # schedule unattended lte firmware upgrade diff --git a/update-gre-address.rsc b/update-gre-address.rsc index 87762d6..4ac311a 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: update-gre-address -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # # requires RouterOS, version=7.14 diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index dd43c64..589544c 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -1,6 +1,6 @@ #!rsc by RouterOS # RouterOS script: update-tunnelbroker -# Copyright (c) 2013-2024 Christian Hesse +# Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # From db508ddcd1a4bb78af95e5d96a4f626173d29557 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:30:05 +0100 Subject: [PATCH 084/273] backup-cloud: refuse when running from backup partition --- backup-cloud.rsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index 37ca92f..f32a04d 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -38,6 +38,14 @@ :set ExitOK true; :error false; } + + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set PackagesUpdateBackupFailure true; + :set ExitOK true; + :error false; + } + $WaitFullyConnected; :if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={ From 303c39390068ebf0ab5cba3bbb967d6079fbdeb2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:30:20 +0100 Subject: [PATCH 085/273] backup-email: refuse when running from backup partition --- backup-email.rsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup-email.rsc b/backup-email.rsc index 489927b..731fb95 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -56,6 +56,14 @@ :set ExitOK true; :error false; } + + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set PackagesUpdateBackupFailure true; + :set ExitOK true; + :error false; + } + $WaitFullyConnected; :if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={ From 6c990079a6c6f92c748f98a5128e7438e05caefb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:26:44 +0100 Subject: [PATCH 086/273] backup-partition: refuse when running from backup partition --- backup-partition.rsc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backup-partition.rsc b/backup-partition.rsc index b2b75ac..2298225 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -47,6 +47,13 @@ :error false; } + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set PackagesUpdateBackupFailure true; + :set ExitOK true; + :error false; + } + :if ([ :len [ /partitions/find ] ] < 2) do={ $LogPrint error $ScriptName ("Device does not have a fallback partition."); :set PackagesUpdateBackupFailure true; From d9693f4d5f783935cd2e47479889cc035b294934 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:30:38 +0100 Subject: [PATCH 087/273] backup-upload: refuse when running from backup partition --- backup-upload.rsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup-upload.rsc b/backup-upload.rsc index e050140..e035415 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -53,6 +53,14 @@ :set ExitOK true; :error false; } + + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set PackagesUpdateBackupFailure true; + :set ExitOK true; + :error false; + } + $WaitFullyConnected; :if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={ From 665516b33de8d4d58d18274e05a0180cf6978af0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:30:59 +0100 Subject: [PATCH 088/273] check-routeros-update: refuse when running from backup partition --- check-routeros-update.rsc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index c3d2625..19abebf 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -51,6 +51,13 @@ :set ExitOK true; :error false; } + + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set ExitOK true; + :error false; + } + $WaitFullyConnected; :if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={ From ce2d090e998d51b92376f3470b829f598f3ce5bd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jan 2025 09:31:13 +0100 Subject: [PATCH 089/273] packages-update: refuse when running from backup partition --- packages-update.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages-update.rsc b/packages-update.rsc index a79946d..7644219 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -50,6 +50,12 @@ :error false; } + :if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={ + $LogPrint warning $ScriptName ("Running from backup partition, refusing to act."); + :set ExitOK true; + :error false; + } + :local Update [ /system/package/update/get ]; :if ([ :typeof ($Update->"latest-version") ] = "nothing") do={ From 98791f48fdb684f946fb94e8735b1073942cd731 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 9 Jan 2025 13:20:45 +0100 Subject: [PATCH 090/273] ppp-on-up: release only bound ipv6 dhcp clients --- ppp-on-up.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc index a776ce2..ba9d0aa 100644 --- a/ppp-on-up.rsc +++ b/ppp-on-up.rsc @@ -28,7 +28,7 @@ :local IntName [ /interface/get $Interface name ]; $LogPrint info $ScriptName ("PPP interface " . $IntName . " is up."); - /ipv6/dhcp-client/release [ find where interface=$IntName !disabled ]; + /ipv6/dhcp-client/release [ find where interface=$IntName !disabled bound ]; :foreach Script in=[ /system/script/find where source~("\n# provides: ppp-on-up\r?\n") ] do={ :local ScriptName [ /system/script/get $Script name ]; From e8b1e19b284af74032e1edcbb08665752dbe508a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 22 Nov 2024 14:06:22 +0100 Subject: [PATCH 091/273] fw-addr-lists: spamhaus.org returned to 'GTS Root R4' --- certs/Makefile | 2 +- global-config.rsc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/certs/Makefile b/certs/Makefile index 9ce8dd4..870cb54 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -22,7 +22,7 @@ DOMAINS = \ sslbl.abuse.ch/GlobalSign \ upgrade.mikrotik.com/ISRG-Root-X1 \ www.dshield.org/ISRG-Root-X1 \ - www.spamhaus.org/ISRG-Root-X1 + www.spamhaus.org/GTS-Root-R4 .PHONY: $(DOMAINS) diff --git a/global-config.rsc b/global-config.rsc index 1f4e9ca..c63283d 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -107,9 +107,9 @@ { url="https://lists.blocklist.de/lists/strongips.txt"; cert="Certum Trusted Network CA" }; # { url="https://www.spamhaus.org/drop/drop_v4.json"; -# cert="ISRG Root X1" }; +# cert="GTS Root R4" }; # { url="https://www.spamhaus.org/drop/drop_v6.json"; -# cert="ISRG Root X1" }; +# cert="GTS Root R4" }; }; # "mikrotik"={ # { url="https://git.eworm.de/cgit/routeros-scripts/plain/fw-addr-lists.d/mikrotik"; From ccf17a438cd10f77f0f0c0cd83f6f6729b6479c7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 23 Jan 2025 23:07:38 +0100 Subject: [PATCH 092/273] global-config: download scripts from rsc.eworm.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently AI bots are crawling website all around the world. For a website hosting git content this adds a lot of extra load and traffic: The site has lots of sections, repositories have a lot of files, branches, tags, commit ids, etc... Multiply that and you have a nearly unlimited number of unique urls. The bots try to get each and every of these. To speed up the learing process on their side a swarm of hundreds, thousands or more ip addresses is active at the same time, ultimately DDOS'ing the websites, making it inaccessible. đŸ˜ŗđŸ¤Ŧ Well, there is one single file all of these AI bots are not interested in: robots.txt đŸ¤ŦđŸ¤Ŧ On top some use random user agent strings, making filtering impossible. đŸ¤ŦđŸ¤ŦđŸ¤Ŧ For a short term sulution I deploy the repository content as static files, hopefully making these accessible at least. We will see. --- global-config.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global-config.rsc b/global-config.rsc index c63283d..3e17320 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -217,14 +217,16 @@ :global GpsTrackUrl "https://example.com/index.php"; # This is the base url to fetch scripts from. -:global ScriptUpdatesBaseUrl "https://git.eworm.de/cgit/routeros-scripts/plain/"; +:global ScriptUpdatesBaseUrl "https://rsc.eworm.de/main/"; # alternative urls - main: stable code - next: currently in development +#:global ScriptUpdatesBaseUrl "https://rsc.eworm.de/next/"; +#:global ScriptUpdatesBaseUrl "https://git.eworm.de/cgit/routeros-scripts/plain/"; #:global ScriptUpdatesBaseUrl "https://raw.githubusercontent.com/eworm-de/routeros-scripts/main/"; #:global ScriptUpdatesBaseUrl "https://raw.githubusercontent.com/eworm-de/routeros-scripts/next/"; #:global ScriptUpdatesBaseUrl "https://gitlab.com/eworm-de/routeros-scripts/raw/main/"; #:global ScriptUpdatesBaseUrl "https://gitlab.com/eworm-de/routeros-scripts/raw/next/"; :global ScriptUpdatesUrlSuffix ""; -# use next branch with default url (git.eworm.de) +# use next branch with my git url (git.eworm.de) #:global ScriptUpdatesUrlSuffix "?h=next"; # Use this for defaults with $ScriptRunOnce From d4acc5aa59e30c5e430b553fb2142c7e7e004822 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 11:03:50 +0100 Subject: [PATCH 093/273] BRANCHES: adopt new default url --- BRANCHES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BRANCHES.md b/BRANCHES.md index 2bacf8e..5d94077 100644 --- a/BRANCHES.md +++ b/BRANCHES.md @@ -22,13 +22,13 @@ for testing. To install a single script from `next` branch: - $ScriptInstallUpdate script-name "url-suffix=?h=next"; + $ScriptInstallUpdate script-name "base-url=https://rsc.eworm.de/next/"; ## Switch existing script Alternatively switch an existing script to update from `next` branch: - /system/script/set comment="url-suffix=?h=next" script-name; + /system/script/set comment="base-url=https://rsc.eworm.de/next/" script-name; $ScriptInstallUpdate; ## Switch installation @@ -36,7 +36,7 @@ Alternatively switch an existing script to update from `next` branch: Last but not least - to switch the complete installation to the `next` branch edit `global-config-overlay` and add: - :global ScriptUpdatesUrlSuffix "?h=next"; + :global ScriptUpdatesBaseUrl "https://rsc.eworm.de/next/"; ... then reload the configuration and update: From a446f31262118d59d6ec938a022b2f7d99fb5a70 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 23 Jan 2025 23:56:18 +0100 Subject: [PATCH 094/273] fw-addr-lists: use my static mirror --- global-config.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global-config.rsc b/global-config.rsc index 3e17320..c8b2c2e 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -92,11 +92,11 @@ # This defines the settings for firewall address-lists (fw-addr-lists). :global FwAddrLists { # "allow"={ -# { url="https://git.eworm.de/cgit/routeros-scripts/plain/fw-addr-lists.d/allow"; +# { url="https://rsc.eworm.de/main/fw-addr-lists.d/allow"; # cert="ISRG Root X2"; timeout=1w }; # }; "block"={ -# { url="https://git.eworm.de/cgit/routeros-scripts/plain/fw-addr-lists.d/block"; +# { url="https://rsc.eworm.de/main/fw-addr-lists.d/block"; # cert="ISRG Root X2" }; { url="https://feodotracker.abuse.ch/downloads/ipblocklist_recommended.txt"; cert="GlobalSign" }; @@ -112,7 +112,7 @@ # cert="GTS Root R4" }; }; # "mikrotik"={ -# { url="https://git.eworm.de/cgit/routeros-scripts/plain/fw-addr-lists.d/mikrotik"; +# { url="https://rsc.eworm.de/main/fw-addr-lists.d/mikrotik"; # cert="ISRG Root X2"; timeout=1w }; # }; }; From 500054535c44f7682bf82712dc37e299299b09dd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:30:01 +0100 Subject: [PATCH 095/273] unattended-lte-firmware-upgrade: require RouterOS --- unattended-lte-firmware-upgrade.rsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc index f1bc552..ea18edf 100644 --- a/unattended-lte-firmware-upgrade.rsc +++ b/unattended-lte-firmware-upgrade.rsc @@ -3,6 +3,8 @@ # Copyright (c) 2018-2025 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # +# requires RouterOS, version=7.14 +# # schedule unattended lte firmware upgrade # https://git.eworm.de/cgit/routeros-scripts/about/doc/unattended-lte-firmware-upgrade.md From 1dda59034e366c6cb6e2b78fa820ece1407f93e5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 096/273] accesslist-duplicates: use short url rsc.eworm.de --- accesslist-duplicates.capsman.rsc | 4 ++-- accesslist-duplicates.local.rsc | 4 ++-- accesslist-duplicates.template.rsc | 4 ++-- accesslist-duplicates.wifi.rsc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/accesslist-duplicates.capsman.rsc b/accesslist-duplicates.capsman.rsc index b611917..0c4eaaf 100644 --- a/accesslist-duplicates.capsman.rsc +++ b/accesslist-duplicates.capsman.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.capsman # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # print duplicate antries in wireless access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md +# https://rsc.eworm.de/doc/accesslist-duplicates.md # # !! Do not edit this file, it is generated from template! diff --git a/accesslist-duplicates.local.rsc b/accesslist-duplicates.local.rsc index ef0cf32..353fe1f 100644 --- a/accesslist-duplicates.local.rsc +++ b/accesslist-duplicates.local.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.local # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # print duplicate antries in wireless access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md +# https://rsc.eworm.de/doc/accesslist-duplicates.md # # !! Do not edit this file, it is generated from template! diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc index ab5b671..4219014 100644 --- a/accesslist-duplicates.template.rsc +++ b/accesslist-duplicates.template.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates%TEMPL% # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # print duplicate antries in wireless access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md +# https://rsc.eworm.de/doc/accesslist-duplicates.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/accesslist-duplicates.wifi.rsc b/accesslist-duplicates.wifi.rsc index 0205598..3ee53d8 100644 --- a/accesslist-duplicates.wifi.rsc +++ b/accesslist-duplicates.wifi.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: accesslist-duplicates.wifi # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # print duplicate antries in wireless access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md +# https://rsc.eworm.de/doc/accesslist-duplicates.md # # !! Do not edit this file, it is generated from template! From 5281b4ba02a721af189ad70244c95cb175c6af06 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 097/273] backup-cloud: use short url rsc.eworm.de --- backup-cloud.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index f32a04d..efae055 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: backup-cloud # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=40 # requires RouterOS, version=7.14 # # upload backup to MikroTik cloud -# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-cloud.md +# https://rsc.eworm.de/doc/backup-cloud.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 08ff07d037d88e7aba7356ba0f744a4e92d597ea Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 098/273] backup-email: use short url rsc.eworm.de --- backup-email.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-email.rsc b/backup-email.rsc index 731fb95..f6ebad0 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: backup-email # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=20 # requires RouterOS, version=7.14 # # create and email backup and config file -# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-email.md +# https://rsc.eworm.de/doc/backup-email.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From c70b6a8eb304641df205c1d18f12670d183a9385 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 099/273] backup-partition: use short url rsc.eworm.de --- backup-partition.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-partition.rsc b/backup-partition.rsc index 2298225..b8bf7b1 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: backup-partition # Copyright (c) 2022-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=70 # requires RouterOS, version=7.14 # # save configuration to fallback partition -# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-partition.md +# https://rsc.eworm.de/doc/backup-partition.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 38b5fbab9cdc9fd755c04a2f7debd2d62ae05aab Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 100/273] backup-upload: use short url rsc.eworm.de --- backup-upload.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-upload.rsc b/backup-upload.rsc index e035415..011c502 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: backup-upload # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=50 # requires RouterOS, version=7.14 # # create and upload backup and config file -# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-upload.md +# https://rsc.eworm.de/doc/backup-upload.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From b938847030e90c8c3b8decb55e6625aa2e537798 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 101/273] capsman-download-packages: use short url rsc.eworm.de --- capsman-download-packages.capsman.rsc | 4 ++-- capsman-download-packages.template.rsc | 4 ++-- capsman-download-packages.wifi.rsc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index 4609498..fa76ff5 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -2,12 +2,12 @@ # RouterOS script: capsman-download-packages.capsman # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # download and cleanup packages for CAP installation from CAPsMAN -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md +# https://rsc.eworm.de/doc/capsman-download-packages.md # # !! Do not edit this file, it is generated from template! diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 642a068..912e279 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -2,12 +2,12 @@ # RouterOS script: capsman-download-packages%TEMPL% # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # download and cleanup packages for CAP installation from CAPsMAN -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md +# https://rsc.eworm.de/doc/capsman-download-packages.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 1ea9b79..3a5e7d1 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -2,12 +2,12 @@ # RouterOS script: capsman-download-packages.wifi # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # download and cleanup packages for CAP installation from CAPsMAN -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md +# https://rsc.eworm.de/doc/capsman-download-packages.md # # !! Do not edit this file, it is generated from template! From 26dbf5805a83a2670e678ec93d02796f7c3233cd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 102/273] capsman-rolling-upgrade: use short url rsc.eworm.de --- capsman-rolling-upgrade.capsman.rsc | 4 ++-- capsman-rolling-upgrade.template.rsc | 4 ++-- capsman-rolling-upgrade.wifi.rsc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/capsman-rolling-upgrade.capsman.rsc b/capsman-rolling-upgrade.capsman.rsc index 7a5ed81..abe066e 100644 --- a/capsman-rolling-upgrade.capsman.rsc +++ b/capsman-rolling-upgrade.capsman.rsc @@ -2,13 +2,13 @@ # RouterOS script: capsman-rolling-upgrade.capsman # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade.capsman # requires RouterOS, version=7.14 # # upgrade CAPs one after another -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md +# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md # # !! Do not edit this file, it is generated from template! diff --git a/capsman-rolling-upgrade.template.rsc b/capsman-rolling-upgrade.template.rsc index fd7e31f..c1c7ff1 100644 --- a/capsman-rolling-upgrade.template.rsc +++ b/capsman-rolling-upgrade.template.rsc @@ -2,13 +2,13 @@ # RouterOS script: capsman-rolling-upgrade%TEMPL% # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade%TEMPL% # requires RouterOS, version=7.14 # # upgrade CAPs one after another -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md +# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/capsman-rolling-upgrade.wifi.rsc b/capsman-rolling-upgrade.wifi.rsc index 3fb99b8..44c99db 100644 --- a/capsman-rolling-upgrade.wifi.rsc +++ b/capsman-rolling-upgrade.wifi.rsc @@ -2,13 +2,13 @@ # RouterOS script: capsman-rolling-upgrade.wifi # Copyright (c) 2018-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade.wifi # requires RouterOS, version=7.14 # # upgrade CAPs one after another -# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md +# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md # # !! Do not edit this file, it is generated from template! From 1b7458ac955dc32ea12f19a779c985f27e0c6a28 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 103/273] certificate-renew-issued: use short url rsc.eworm.de --- certificate-renew-issued.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc index 32c3267..5a4043d 100644 --- a/certificate-renew-issued.rsc +++ b/certificate-renew-issued.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: certificate-renew-issued # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # renew locally issued certificates -# https://git.eworm.de/cgit/routeros-scripts/about/doc/certificate-renew-issued.md +# https://rsc.eworm.de/doc/certificate-renew-issued.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 1239ac31044270036a8204cd7856776d8faee06e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 104/273] check-certificates: use short url rsc.eworm.de --- check-certificates.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 226364b..02e3e52 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: check-certificates # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # check for certificate validity -# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-certificates.md +# https://rsc.eworm.de/doc/check-certificates.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 231be730aea0bad7a914c387a719d7c46ecbb468 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 105/273] check-health: use short url rsc.eworm.de --- check-health.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-health.rsc b/check-health.rsc index d3586db..31bd6c2 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: check-health # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # check for RouterOS health state -# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-health.md +# https://rsc.eworm.de/doc/check-health.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 7484663b92062ae6c120227de22d387df93123ad Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 106/273] check-lte-firmware-upgrade: use short url rsc.eworm.de --- check-lte-firmware-upgrade.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc index cd9f979..562b8fe 100644 --- a/check-lte-firmware-upgrade.rsc +++ b/check-lte-firmware-upgrade.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: check-lte-firmware-upgrade # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # check for LTE firmware upgrade, send notification -# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-lte-firmware-upgrade.md +# https://rsc.eworm.de/doc/check-lte-firmware-upgrade.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 36c87c91ea9b4bc5ef1153733d38e52ad0e3e291 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 107/273] check-routeros-update: use short url rsc.eworm.de --- check-routeros-update.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 19abebf..9486d6c 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: check-routeros-update # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # check for RouterOS update, send notification and/or install -# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-routeros-update.md +# https://rsc.eworm.de/doc/check-routeros-update.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From f8058eaf71c54fb722fb65c5e87c9f448927a36e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 108/273] collect-wireless-mac: use short url rsc.eworm.de --- collect-wireless-mac.capsman.rsc | 4 ++-- collect-wireless-mac.local.rsc | 4 ++-- collect-wireless-mac.template.rsc | 4 ++-- collect-wireless-mac.wifi.rsc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc index 05e4b89..f718e0b 100644 --- a/collect-wireless-mac.capsman.rsc +++ b/collect-wireless-mac.capsman.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.capsman # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 # requires RouterOS, version=7.14 # # collect wireless mac adresses in access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md +# https://rsc.eworm.de/doc/collect-wireless-mac.md # # !! Do not edit this file, it is generated from template! diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc index 67c1a98..0017875 100644 --- a/collect-wireless-mac.local.rsc +++ b/collect-wireless-mac.local.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.local # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 # requires RouterOS, version=7.14 # # collect wireless mac adresses in access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md +# https://rsc.eworm.de/doc/collect-wireless-mac.md # # !! Do not edit this file, it is generated from template! diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc index 84a9667..527e985 100644 --- a/collect-wireless-mac.template.rsc +++ b/collect-wireless-mac.template.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac%TEMPL% # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 # requires RouterOS, version=7.14 # # collect wireless mac adresses in access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md +# https://rsc.eworm.de/doc/collect-wireless-mac.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc index fa4953b..5f9de7d 100644 --- a/collect-wireless-mac.wifi.rsc +++ b/collect-wireless-mac.wifi.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: collect-wireless-mac.wifi # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 # requires RouterOS, version=7.14 # # collect wireless mac adresses in access list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md +# https://rsc.eworm.de/doc/collect-wireless-mac.md # # !! Do not edit this file, it is generated from template! From 96fa76f07dfe86d31f32c90e969cb824d727280a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 109/273] daily-psk.template: use short url rsc.eworm.de --- daily-psk.capsman.rsc | 4 ++-- daily-psk.local.rsc | 4 ++-- daily-psk.template.rsc | 4 ++-- daily-psk.wifi.rsc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc index f41da29..5672931 100644 --- a/daily-psk.capsman.rsc +++ b/daily-psk.capsman.rsc @@ -2,12 +2,12 @@ # RouterOS script: daily-psk.capsman # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # update daily PSK (pre shared key) -# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md +# https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc index 2920cb5..9dea469 100644 --- a/daily-psk.local.rsc +++ b/daily-psk.local.rsc @@ -2,12 +2,12 @@ # RouterOS script: daily-psk.local # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # update daily PSK (pre shared key) -# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md +# https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 05c376e..8202eeb 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -2,12 +2,12 @@ # RouterOS script: daily-psk%TEMPL% # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # update daily PSK (pre shared key) -# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md +# https://rsc.eworm.de/doc/daily-psk.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/daily-psk.wifi.rsc b/daily-psk.wifi.rsc index 4182ab8..3de3c5b 100644 --- a/daily-psk.wifi.rsc +++ b/daily-psk.wifi.rsc @@ -2,12 +2,12 @@ # RouterOS script: daily-psk.wifi # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # update daily PSK (pre shared key) -# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md +# https://rsc.eworm.de/doc/daily-psk.md # # !! Do not edit this file, it is generated from template! From 61dee2177634b6e464aab4b644eb686f914cb365 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 110/273] dhcp-lease-comment: use short url rsc.eworm.de --- dhcp-lease-comment.capsman.rsc | 4 ++-- dhcp-lease-comment.local.rsc | 4 ++-- dhcp-lease-comment.template.rsc | 4 ++-- dhcp-lease-comment.wifi.rsc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index 947181b..3803963 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.capsman # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 # requires RouterOS, version=7.14 # # update dhcp-server lease comment with infos from access-list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md +# https://rsc.eworm.de/doc/dhcp-lease-comment.md # # !! Do not edit this file, it is generated from template! diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 27306dd..d5f1461 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.local # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 # requires RouterOS, version=7.14 # # update dhcp-server lease comment with infos from access-list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md +# https://rsc.eworm.de/doc/dhcp-lease-comment.md # # !! Do not edit this file, it is generated from template! diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index 8552b26..2bddc26 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment%TEMPL% # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 # requires RouterOS, version=7.14 # # update dhcp-server lease comment with infos from access-list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md +# https://rsc.eworm.de/doc/dhcp-lease-comment.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc index bf67bd0..515b438 100644 --- a/dhcp-lease-comment.wifi.rsc +++ b/dhcp-lease-comment.wifi.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: dhcp-lease-comment.wifi # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 # requires RouterOS, version=7.14 # # update dhcp-server lease comment with infos from access-list -# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md +# https://rsc.eworm.de/doc/dhcp-lease-comment.md # # !! Do not edit this file, it is generated from template! From 632d294a988188eb9ea182316d28411b8c281ed2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 111/273] dhcp-to-dns: use short url rsc.eworm.de --- dhcp-to-dns.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 1eb832a..9b94098 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: dhcp-to-dns # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=20 # requires RouterOS, version=7.16 # # check DHCP leases and add/remove/update DNS entries -# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md +# https://rsc.eworm.de/doc/dhcp-to-dns.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 7b760d9fa408b12ef00328266c77707f835f0600 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 112/273] firmware-upgrade-reboot: use short url rsc.eworm.de --- firmware-upgrade-reboot.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc index f9e557c..e3d62de 100644 --- a/firmware-upgrade-reboot.rsc +++ b/firmware-upgrade-reboot.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: firmware-upgrade-reboot # Copyright (c) 2022-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # install firmware upgrade, and reboot -# https://git.eworm.de/cgit/routeros-scripts/about/doc/firmware-upgrade-reboot.md +# https://rsc.eworm.de/doc/firmware-upgrade-reboot.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 39c5aeda13e107f1dd91fc632cab536befeca6eb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 113/273] fw-addr-lists: use short url rsc.eworm.de --- fw-addr-lists.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index e98a610..d41dc04 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: fw-addr-lists # Copyright (c) 2023-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.16 # # download, import and update firewall address-lists -# https://git.eworm.de/cgit/routeros-scripts/about/doc/fw-addr-lists.md +# https://rsc.eworm.de/doc/fw-addr-lists.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From ac62b8f24fc72aefbb9994abac3baa07bd3cfa93 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 114/273] global-config-overlay: use short url rsc.eworm.de --- global-config-overlay.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global-config-overlay.rsc b/global-config-overlay.rsc index 227ae5a..9afaceb 100644 --- a/global-config-overlay.rsc +++ b/global-config-overlay.rsc @@ -1,12 +1,12 @@ # Overlay for global configuration by RouterOS Scripts # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # global configuration, custom overlay -# https://git.eworm.de/cgit/routeros-scripts/about/#editing-configuration +# https://rsc.eworm.de/#editing-configuration # Copy relevant configuration from global-config, paste and modify it here. -# https://git.eworm.de/cgit/routeros-scripts/about/global-config.rsc +# https://rsc.eworm.de/global-config.rsc # End of global-config-overlay From b7923485bdac90458321989eda261517afc4986e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 115/273] global-config: use short url rsc.eworm.de --- global-config.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global-config.rsc b/global-config.rsc index c8b2c2e..df26ef9 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -1,10 +1,10 @@ #!rsc by RouterOS # RouterOS script: global-config # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # global configuration -# https://git.eworm.de/cgit/routeros-scripts/about/ +# https://rsc.eworm.de/ # Set this to 'true' to disable news and change notifications. :global NoNewsAndChangesNotification false; @@ -238,7 +238,7 @@ # This project is developed in private spare time and usage is free of charge # for you. If you like the scripts and think this is of value for you or your # business please consider a donation: -# https://git.eworm.de/cgit/routeros-scripts/about/#donate +# https://rsc.eworm.de/#donate # Enable this to silence donation hint. :global IDonate false; From 7be415d0ed8238564608c47b251f21f25e6f1d43 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 116/273] global-functions: use short url rsc.eworm.de --- global-functions.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index a2dd279..d5ac31c 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -2,12 +2,12 @@ # RouterOS script: global-functions # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # global functions -# https://git.eworm.de/cgit/routeros-scripts/about/ +# https://rsc.eworm.de/ :local ScriptName [ :jobname ]; From 0431b02324877ae8585eb31effd789747f2aaf96 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 117/273] global-wait: use short url rsc.eworm.de --- global-wait.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-wait.rsc b/global-wait.rsc index 529dbd7..bc98462 100644 --- a/global-wait.rsc +++ b/global-wait.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: global-wait # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # wait for global-functions to finish -# https://git.eworm.de/cgit/routeros-scripts/about/doc/global-wait.md +# https://rsc.eworm.de/doc/global-wait.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 72db13c0ab7bc2ba71400bb74976391d7a78e925 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 118/273] gps-track: use short url rsc.eworm.de --- gps-track.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gps-track.rsc b/gps-track.rsc index 1bd976a..08873de 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: gps-track # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # track gps data by sending json data to http server -# https://git.eworm.de/cgit/routeros-scripts/about/doc/gps-track.md +# https://rsc.eworm.de/doc/gps-track.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 996602bfe9f0363edae13c51604c23f46546ac49 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 119/273] hotspot-to-wpa-cleanup: use short url rsc.eworm.de --- hotspot-to-wpa-cleanup.capsman.rsc | 4 ++-- hotspot-to-wpa-cleanup.template.rsc | 4 ++-- hotspot-to-wpa-cleanup.wifi.rsc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index 1d27faf..fde36f9 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup.capsman # Copyright (c) 2021-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 # requires RouterOS, version=7.14 # # manage and clean up private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! Do not edit this file, it is generated from template! diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index f92dbe5..3ddcbe0 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup%TEMPL% # Copyright (c) 2021-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 # requires RouterOS, version=7.14 # # manage and clean up private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index cd21593..034530b 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa-cleanup.wifi # Copyright (c) 2021-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 # requires RouterOS, version=7.14 # # manage and clean up private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! Do not edit this file, it is generated from template! From 9474102c62b4e9d36f908e40e14031da5a6fc116 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 120/273] hotspot-to-wpa: use short url rsc.eworm.de --- hotspot-to-wpa.capsman.rsc | 4 ++-- hotspot-to-wpa.template.rsc | 4 ++-- hotspot-to-wpa.wifi.rsc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc index d962ba7..1c77de9 100644 --- a/hotspot-to-wpa.capsman.rsc +++ b/hotspot-to-wpa.capsman.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa.capsman # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # add private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! Do not edit this file, it is generated from template! diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc index 3438be7..d8cd261 100644 --- a/hotspot-to-wpa.template.rsc +++ b/hotspot-to-wpa.template.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa%TEMPL% # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # add private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! This is just a template to generate the real script! # !! Pattern '%TEMPL%' is replaced, paths are filtered. diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc index a2bb3ca..345087d 100644 --- a/hotspot-to-wpa.wifi.rsc +++ b/hotspot-to-wpa.wifi.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: hotspot-to-wpa.wifi # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # add private WPA passphrase after hotspot login -# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md +# https://rsc.eworm.de/doc/hotspot-to-wpa.md # # !! Do not edit this file, it is generated from template! From 453d80a121f7e92602466490b77b7d47ba3ef251 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 121/273] ip-addr-bridge: use short url rsc.eworm.de --- ip-addr-bridge.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip-addr-bridge.rsc b/ip-addr-bridge.rsc index 00b45a3..68ff4a4 100644 --- a/ip-addr-bridge.rsc +++ b/ip-addr-bridge.rsc @@ -1,10 +1,10 @@ #!rsc by RouterOS # RouterOS script: ip-addr-bridge # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # enable or disable ip addresses based on bridge port state -# https://git.eworm.de/cgit/routeros-scripts/about/doc/ip-addr-bridge.md +# https://rsc.eworm.de/doc/ip-addr-bridge.md :foreach Bridge in=[ /interface/bridge/find ] do={ :local BrName [ /interface/bridge/get $Bridge name ]; From 02cc581aff6c6a4191620450e5607c74aeaca203 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 122/273] ipsec-to-dns: use short url rsc.eworm.de --- ipsec-to-dns.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index 39b21d5..1af5809 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: ipsec-to-dns # Copyright (c) 2021-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # and add/remove/update DNS entries from IPSec mode-config -# https://git.eworm.de/cgit/routeros-scripts/about/doc/ipsec-to-dns.md +# https://rsc.eworm.de/doc/ipsec-to-dns.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 71316f7377987124858d74a9f5f741a133047dec Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 123/273] ipv6-update: use short url rsc.eworm.de --- ipv6-update.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipv6-update.rsc b/ipv6-update.rsc index a2fb831..7eb625b 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: ipv6-update # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # update firewall and dns settings on IPv6 prefix change -# https://git.eworm.de/cgit/routeros-scripts/about/doc/ipv6-update.md +# https://rsc.eworm.de/doc/ipv6-update.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 5ead61cb6269ab5f2e6c145a4736765d938f6305 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 124/273] lease-script: use short url rsc.eworm.de --- lease-script.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lease-script.rsc b/lease-script.rsc index 3d0fc72..b6ceac9 100644 --- a/lease-script.rsc +++ b/lease-script.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: lease-script # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # run scripts on DHCP lease -# https://git.eworm.de/cgit/routeros-scripts/about/doc/lease-script.md +# https://rsc.eworm.de/doc/lease-script.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 5e60d2e1b7d1973a18737042e94d3e0ba262db14 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 125/273] leds-day-mode: use short url rsc.eworm.de --- leds-day-mode.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leds-day-mode.rsc b/leds-day-mode.rsc index e0f08d6..7344fde 100644 --- a/leds-day-mode.rsc +++ b/leds-day-mode.rsc @@ -1,9 +1,9 @@ #!rsc by RouterOS # RouterOS script: leds-day-mode # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # enable LEDs -# https://git.eworm.de/cgit/routeros-scripts/about/doc/leds-mode.md +# https://rsc.eworm.de/doc/leds-mode.md /system/leds/settings/set all-leds-off=never; From bf11489d11058562a1a10b883dbdb1d06f8c1a8e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 126/273] leds-night-mode: use short url rsc.eworm.de --- leds-night-mode.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leds-night-mode.rsc b/leds-night-mode.rsc index 1f50dfd..8bd028e 100644 --- a/leds-night-mode.rsc +++ b/leds-night-mode.rsc @@ -1,9 +1,9 @@ #!rsc by RouterOS # RouterOS script: leds-night-mode # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # disable LEDs -# https://git.eworm.de/cgit/routeros-scripts/about/doc/leds-mode.md +# https://rsc.eworm.de/doc/leds-mode.md /system/leds/settings/set all-leds-off=immediate; From b75a35417a4dc0793515275bdee8443248f5762c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 127/273] leds-toggle-mode: use short url rsc.eworm.de --- leds-toggle-mode.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leds-toggle-mode.rsc b/leds-toggle-mode.rsc index 55d5b82..b55e351 100644 --- a/leds-toggle-mode.rsc +++ b/leds-toggle-mode.rsc @@ -1,9 +1,9 @@ #!rsc by RouterOS # RouterOS script: leds-toggle-mode # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # toggle LEDs mode -# https://git.eworm.de/cgit/routeros-scripts/about/doc/leds-mode.md +# https://rsc.eworm.de/doc/leds-mode.md /system/leds/settings/set all-leds-off=(({ "never"="immediate"; "immediate"="never" })->[ get all-leds-off ]); From b8841a71356c6e25870913183d10ef9a8732a42d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 128/273] log-forward: use short url rsc.eworm.de --- log-forward.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log-forward.rsc b/log-forward.rsc index 8c2ebc0..379fa54 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: log-forward # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # forward log messages via notification -# https://git.eworm.de/cgit/routeros-scripts/about/doc/log-forward.md +# https://rsc.eworm.de/doc/log-forward.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 6920842d1584a7c8b3a7208c1230a373d2932a8d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 129/273] mod/bridge-port-to: use short url rsc.eworm.de --- mod/bridge-port-to.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc index ec6f612..f00e10b 100644 --- a/mod/bridge-port-to.rsc +++ b/mod/bridge-port-to.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/bridge-port-to # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # reset bridge ports to default bridge -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/bridge-port-to.md +# https://rsc.eworm.de/doc/mod/bridge-port-to.md :global BridgePortTo; From d5a50d824f0343a70e1945127b42dde719d761d2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 130/273] mod/bridge-port-vlan: use short url rsc.eworm.de --- mod/bridge-port-vlan.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/bridge-port-vlan.rsc b/mod/bridge-port-vlan.rsc index 6221646..62e71e3 100644 --- a/mod/bridge-port-vlan.rsc +++ b/mod/bridge-port-vlan.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/bridge-port-vlan # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # manage VLANs on bridge ports -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/bridge-port-vlan.md +# https://rsc.eworm.de/doc/mod/bridge-port-vlan.md :global BridgePortVlan; From 18fcecd21126b72c9ba1aef4375450bb8751feb3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 131/273] mode-button: use short url rsc.eworm.de --- mode-button.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mode-button.rsc b/mode-button.rsc index f8bd7b8..9339f1c 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mode-button # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # act on multiple mode and reset button presses -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mode-button.md +# https://rsc.eworm.de/doc/mode-button.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 078d5368fbfa195d1e6584b3789cfb3078babad7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 132/273] mod/inspectvar: use short url rsc.eworm.de --- mod/inspectvar.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/inspectvar.rsc b/mod/inspectvar.rsc index 01724bb..0f05da7 100644 --- a/mod/inspectvar.rsc +++ b/mod/inspectvar.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/inspectvar # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # inspect variables -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/inspectvar.md +# https://rsc.eworm.de/doc/mod/inspectvar.md :global InspectVar; :global InspectVarReturn; From 828f68be3c85a43e28884546f74dab3aca403eb9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 133/273] mod/ipcalc: use short url rsc.eworm.de --- mod/ipcalc.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/ipcalc.rsc b/mod/ipcalc.rsc index 69dec8b..fbed74b 100644 --- a/mod/ipcalc.rsc +++ b/mod/ipcalc.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/ipcalc # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # ip address calculation -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/ipcalc.md +# https://rsc.eworm.de/doc/mod/ipcalc.md :global IPCalc; :global IPCalcReturn; From 631f63836b6b758c4ff3816ffdd5c76d95d31961 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 134/273] mod/notification-email: use short url rsc.eworm.de --- mod/notification-email.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 6d700f5..ca23550 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/notification-email # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # send notifications via e-mail -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/notification-email.md +# https://rsc.eworm.de/doc/mod/notification-email.md :global EMailGenerateFrom; :global FlushEmailQueue; From 6567a94a4f4e263308a0b01663448179e6554821 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 135/273] mod/notification-matrix: use short url rsc.eworm.de --- mod/notification-matrix.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index aad8b42..aee231d 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -2,12 +2,12 @@ # RouterOS script: mod/notification-matrix # Copyright (c) 2013-2025 Michael Gisbers # Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # send notifications via Matrix -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/notification-matrix.md +# https://rsc.eworm.de/doc/mod/notification-matrix.md :global FlushMatrixQueue; :global NotificationFunctions; From 6e7f311269a1694dbc243eb60a363f1db4d89cd8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 136/273] mod/notification-ntfy: use short url rsc.eworm.de --- mod/notification-ntfy.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 53ba9b4..df252bb 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/notification-ntfy # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # send notifications via Ntfy (ntfy.sh) -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/notification-ntfy.md +# https://rsc.eworm.de/doc/mod/notification-ntfy.md :global FlushNtfyQueue; :global NotificationFunctions; From 27144a428a03241a7e67859bfa6acfc37e62f6dc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 137/273] mod/notification-telegram: use short url rsc.eworm.de --- mod/notification-telegram.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index f9700cf..a20367c 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/notification-telegram # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # send notifications via Telegram -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/notification-telegram.md +# https://rsc.eworm.de/doc/mod/notification-telegram.md :global FlushTelegramQueue; :global NotificationFunctions; From 66ab2a85114165ca2b5f4f5a6e221eed4c560b45 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 138/273] mod/scriptrunonce: use short url rsc.eworm.de --- mod/scriptrunonce.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index 7e01e72..cae2b05 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/scriptrunonece # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # download script and run it once -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/scriptrunonce.md +# https://rsc.eworm.de/doc/mod/scriptrunonce.md :global ScriptRunOnce; From ed184445783921343498f4f3589df858b2754cbd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 139/273] mod/ssh-keys-import: use short url rsc.eworm.de --- mod/ssh-keys-import.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index ad3a81e..35aa7ec 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: mod/ssh-keys-import # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.16 # # import ssh keys for public key authentication -# https://git.eworm.de/cgit/routeros-scripts/about/doc/mod/ssh-keys-import.md +# https://rsc.eworm.de/doc/mod/ssh-keys-import.md :global SSHKeysImport; :global SSHKeysImportFile; From 299b34883ff508291dfa4acf04118695223c0cd3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 140/273] netwatch-dns: use short url rsc.eworm.de --- netwatch-dns.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index 81f9d95..e05c3ac 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: netwatch-dns # Copyright (c) 2022-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.16 # # monitor and manage dns/doh with netwatch -# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-dns.md +# https://rsc.eworm.de/doc/netwatch-dns.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 563aeb8f71da109060961a16541f56c7dc019e2b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 141/273] netwatch-notify: use short url rsc.eworm.de --- netwatch-notify.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index e79977e..8b05c5e 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: netwatch-notify # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # monitor netwatch and send notifications -# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-notify.md +# https://rsc.eworm.de/doc/netwatch-notify.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 719079c5c1298a4800ac482247ee9ac5a9502740 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 142/273] news-and-changes: use short url rsc.eworm.de --- news-and-changes.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news-and-changes.rsc b/news-and-changes.rsc index 545a0c9..7508b43 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -1,6 +1,6 @@ # News, changes and migration by RouterOS Scripts # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md :global IDonate; From 3b0ea3a2388c69914fa76204c6e940b60f6aee83 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 143/273] ospf-to-leds: use short url rsc.eworm.de --- ospf-to-leds.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc index 3400e7f..9d822c1 100644 --- a/ospf-to-leds.rsc +++ b/ospf-to-leds.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: ospf-to-leds # Copyright (c) 2020-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # visualize ospf instance state via leds -# https://git.eworm.de/cgit/routeros-scripts/about/doc/ospf-to-leds.md +# https://rsc.eworm.de/doc/ospf-to-leds.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 90a148a9d86f069048974399feca29a7911e833d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 144/273] packages-update: use short url rsc.eworm.de --- packages-update.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages-update.rsc b/packages-update.rsc index 7644219..9971e47 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: packages-update # Copyright (c) 2019-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # download packages and reboot for installation -# https://git.eworm.de/cgit/routeros-scripts/about/doc/packages-update.md +# https://rsc.eworm.de/doc/packages-update.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 867e504c94faf9d87b8caa6e4d77cd5426af9f73 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 145/273] ppp-on-up: use short url rsc.eworm.de --- ppp-on-up.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc index ba9d0aa..85e9689 100644 --- a/ppp-on-up.rsc +++ b/ppp-on-up.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: ppp-on-up # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # run scripts on ppp up -# https://git.eworm.de/cgit/routeros-scripts/about/doc/ppp-on-up.md +# https://rsc.eworm.de/doc/ppp-on-up.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 1f5aea9fca6ecd5706cb29c8226109281333510d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 146/273] sms-action: use short url rsc.eworm.de --- sms-action.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sms-action.rsc b/sms-action.rsc index f22a0bb..34d2127 100644 --- a/sms-action.rsc +++ b/sms-action.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: sms-action # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # run action on received SMS -# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-action.md +# https://rsc.eworm.de/doc/sms-action.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 7addf2e53a73e230aeac962c9b86a1f1f7e2ddd4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 147/273] sms-forward: use short url rsc.eworm.de --- sms-forward.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sms-forward.rsc b/sms-forward.rsc index efebb75..654fd56 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -2,12 +2,12 @@ # RouterOS script: sms-forward # Copyright (c) 2013-2025 Christian Hesse # Anatoly Bubenkov -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # forward SMS to e-mail -# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md +# https://rsc.eworm.de/doc/sms-forward.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From dd2854e983685ae39465c4375bbdb7b4d27956e8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 148/273] super-mario-theme: use short url rsc.eworm.de --- super-mario-theme.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/super-mario-theme.rsc b/super-mario-theme.rsc index fc868c8..726c526 100644 --- a/super-mario-theme.rsc +++ b/super-mario-theme.rsc @@ -1,10 +1,10 @@ #!rsc by RouterOS # RouterOS script: super-mario-theme # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # play Super Mario theme -# https://git.eworm.de/cgit/routeros-scripts/about/doc/super-mario-theme.md +# https://rsc.eworm.de/doc/super-mario-theme.md :local Beeps { { 660; 100 }; 150; { 660; 100 }; 300; { 660; 100 }; 300; From e3ca37ad9a6f49ae5990e0fb4630d40e77153439 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:12 +0100 Subject: [PATCH 149/273] telegram-chat: use short url rsc.eworm.de --- telegram-chat.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index eebb617..dcdbefa 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: telegram-chat # Copyright (c) 2023-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 # # use Telegram to chat with your Router and send commands -# https://git.eworm.de/cgit/routeros-scripts/about/doc/telegram-chat.md +# https://rsc.eworm.de/doc/telegram-chat.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 32ac10e6efcd8967b998aef066220a75d4819e0c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 150/273] unattended-lte-firmware-upgrade: use short url rsc.eworm.de --- unattended-lte-firmware-upgrade.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc index ea18edf..c7df92f 100644 --- a/unattended-lte-firmware-upgrade.rsc +++ b/unattended-lte-firmware-upgrade.rsc @@ -1,12 +1,12 @@ #!rsc by RouterOS # RouterOS script: unattended-lte-firmware-upgrade # Copyright (c) 2018-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # schedule unattended lte firmware upgrade -# https://git.eworm.de/cgit/routeros-scripts/about/doc/unattended-lte-firmware-upgrade.md +# https://rsc.eworm.de/doc/unattended-lte-firmware-upgrade.md :foreach Interface in=[ /interface/lte/find where running ] do={ :local Firmware; From 49aef0606bb36ee1b0d2ed93e7ce6b63d38338da Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 151/273] update-gre-address: use short url rsc.eworm.de --- update-gre-address.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-gre-address.rsc b/update-gre-address.rsc index 4ac311a..6b169a0 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -1,13 +1,13 @@ #!rsc by RouterOS # RouterOS script: update-gre-address # Copyright (c) 2013-2025 Christian Hesse -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 # # update gre interface remote address with dynamic address from # ipsec remote peer -# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md +# https://rsc.eworm.de/doc/update-gre-address.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From c04ee5aadf4880bcea019f1cdcc1bfca918cce2c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Jan 2025 20:46:11 +0100 Subject: [PATCH 152/273] update-tunnelbroker: use short url rsc.eworm.de --- update-tunnelbroker.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index 589544c..c47a45f 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -2,13 +2,13 @@ # RouterOS script: update-tunnelbroker # Copyright (c) 2013-2025 Christian Hesse # Michael Gisbers -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md +# https://rsc.eworm.de/COPYING.md # # provides: ppp-on-up # requires RouterOS, version=7.14 # # update local address of tunnelbroker interface -# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-tunnelbroker.md +# https://rsc.eworm.de/doc/update-tunnelbroker.md :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } From 106a9bddefd7577b4baf7ae1d78e1bbde09b281e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 09:18:48 +0100 Subject: [PATCH 153/273] README: give hint on device mode --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 98209bd..8594f58 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,12 @@ Specific scripts may require even newer RouterOS version. > â„šī¸ **Info**: The `main` branch is now RouterOS v7 only. If you are still > running RouterOS v6 switch to `routeros-v6` branch! +Starting with RouterOS 7.17 the +[device-mode](https://help.mikrotik.com/docs/spaces/ROS/pages/93749258/Device-mode) +has been extended to give more fine-grained control over what features are +available. You need to enable `scheduler` and `fetch` at least, specific +scripts may require additional features. + ### Hardware RouterOS packages increase in size with each release. This becomes a From b177e298d7b447c41854d840eed6f687b6cec8b6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 09:45:25 +0100 Subject: [PATCH 154/273] global-functions: $ScriptInstallUpdate: support checking for device-mode features --- global-functions.rsc | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index d5ac31c..7d65f45 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -5,6 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch, scheduler # # global functions # https://rsc.eworm.de/ @@ -1071,6 +1072,7 @@ :local ExpectedConfigVersionBefore $ExpectedConfigVersion; :local ReloadGlobalFunctions false; :local ReloadGlobalConfig false; + :local DeviceMode [ /system/device-mode/get ]; :foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={ :local ScriptVal [ /system/script/get $Script ]; @@ -1113,19 +1115,31 @@ :if ([ :pick $SourceNew 0 18 ] = "#!rsc by RouterOS\n") do={ :local Required ([ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires RouterOS, ") ] ]->"version"); :if ([ $RequiredRouterOS $0 [ $EitherOr $Required "0.0" ] false ] = true) do={ - :if ([ $ValidateSyntax $SourceNew ] = true) do={ - $LogPrint info $0 ("Updating script: " . $ScriptVal->"name"); - /system/script/set owner=($ScriptVal->"name") \ - source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script; - :if ($ScriptVal->"name" = "global-config") do={ - :set ReloadGlobalConfig true; + :local RequiredDM [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires device-mode, ") ] ]; + :local MissingDM ({}); + :foreach Feature,Value in=$RequiredDM do={ + :if ([ :typeof ($DeviceMode->$Feature) ] = "bool" && ($DeviceMode->$Feature) = false) do={ + :set MissingDM ($MissingDM, $Feature); } - :if ($ScriptVal->"name" = "global-functions" || $ScriptVal->"name" ~ ("^mod/.")) do={ - :set ReloadGlobalFunctions true; + } + :if ([ :len $MissingDM ] = 0) do={ + :if ([ $ValidateSyntax $SourceNew ] = true) do={ + $LogPrint info $0 ("Updating script: " . $ScriptVal->"name"); + /system/script/set owner=($ScriptVal->"name") \ + source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script; + :if ($ScriptVal->"name" = "global-config") do={ + :set ReloadGlobalConfig true; + } + :if ($ScriptVal->"name" = "global-functions" || $ScriptVal->"name" ~ ("^mod/.")) do={ + :set ReloadGlobalFunctions true; + } + } else={ + $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . \ + "' failed! Ignoring!"); } } else={ - $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . \ - "' failed! Ignoring!"); + $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires disabled " . \ + "device-mode features (" . [ :tostr $MissingDM ] . "). Ignoring!"); } } else={ $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \ From aebc4e37da1a8e9ed1b343a83c7d60ac50fab9d5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:26:22 +0100 Subject: [PATCH 155/273] backup-partition: add dependencies on device-mode --- backup-partition.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/backup-partition.rsc b/backup-partition.rsc index b8bf7b1..bfa7765 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -5,6 +5,7 @@ # # provides: backup-script, order=70 # requires RouterOS, version=7.14 +# requires device-mode, scheduler # # save configuration to fallback partition # https://rsc.eworm.de/doc/backup-partition.md From d81a786e8288fea463c7188f1939c59713add31a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:20:26 +0100 Subject: [PATCH 156/273] backup-upload: add dependencies on device-mode --- backup-upload.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/backup-upload.rsc b/backup-upload.rsc index 011c502..dc5120f 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -5,6 +5,7 @@ # # provides: backup-script, order=50 # requires RouterOS, version=7.14 +# requires device-mode, fetch # # create and upload backup and config file # https://rsc.eworm.de/doc/backup-upload.md From 95b675f67ec9d7c5a9df01a54c1754834b02beee Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:21:12 +0100 Subject: [PATCH 157/273] check-certificates: add dependencies on device-mode --- check-certificates.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/check-certificates.rsc b/check-certificates.rsc index 02e3e52..4271e00 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch # # check for certificate validity # https://rsc.eworm.de/doc/check-certificates.md From 43f6c0b975bb4db73131f78014ca3d59123bd4a6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:21:26 +0100 Subject: [PATCH 158/273] check-routeros-update: add dependencies on device-mode --- check-routeros-update.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 9486d6c..5c9b392 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch, scheduler # # check for RouterOS update, send notification and/or install # https://rsc.eworm.de/doc/check-routeros-update.md From bc0227c49b99372ff46516e55175cf6ae1da31d3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:21:40 +0100 Subject: [PATCH 159/273] gps-track: add dependencies on device-mode --- gps-track.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/gps-track.rsc b/gps-track.rsc index 08873de..5e35f8d 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch # # track gps data by sending json data to http server # https://rsc.eworm.de/doc/gps-track.md From e29ef31eb85e9b9001536ed1bb63a0b479cf4cad Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:35:31 +0100 Subject: [PATCH 160/273] hotspot-to-wpa: add dependencies on device-mode --- hotspot-to-wpa.capsman.rsc | 1 + hotspot-to-wpa.template.rsc | 1 + hotspot-to-wpa.wifi.rsc | 1 + 3 files changed, 3 insertions(+) diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc index 1c77de9..de9f9d9 100644 --- a/hotspot-to-wpa.capsman.rsc +++ b/hotspot-to-wpa.capsman.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # add private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc index d8cd261..003b12e 100644 --- a/hotspot-to-wpa.template.rsc +++ b/hotspot-to-wpa.template.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # add private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc index 345087d..0d6a7b9 100644 --- a/hotspot-to-wpa.wifi.rsc +++ b/hotspot-to-wpa.wifi.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # add private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md From 1ad4d05be8a69490902308baa515b8c87095bb2d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:35:23 +0100 Subject: [PATCH 161/273] hotspot-to-wpa-cleanup: add dependencies on device-mode --- hotspot-to-wpa-cleanup.capsman.rsc | 1 + hotspot-to-wpa-cleanup.template.rsc | 1 + hotspot-to-wpa-cleanup.wifi.rsc | 1 + 3 files changed, 3 insertions(+) diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index fde36f9..c21ec3e 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -5,6 +5,7 @@ # # provides: lease-script, order=80 # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index 3ddcbe0..1bd877e 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -5,6 +5,7 @@ # # provides: lease-script, order=80 # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index 034530b..8e36204 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -5,6 +5,7 @@ # # provides: lease-script, order=80 # requires RouterOS, version=7.14 +# requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login # https://rsc.eworm.de/doc/hotspot-to-wpa.md From 5f1cbe6de5466ccaaf1b5eb29f7087f04cf342c3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:25:15 +0100 Subject: [PATCH 162/273] ipsec-to-dns: add dependencies on device-mode --- ipsec-to-dns.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index 1af5809..91f6b45 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, ipsec # # and add/remove/update DNS entries from IPSec mode-config # https://rsc.eworm.de/doc/ipsec-to-dns.md From 56e74268b079fba7bda8803c0d88eeb67d0f4397 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:31:30 +0100 Subject: [PATCH 163/273] mode-button: add dependencies on device-mode --- mode-button.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mode-button.rsc b/mode-button.rsc index 9339f1c..4cf5e75 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, scheduler # # act on multiple mode and reset button presses # https://rsc.eworm.de/doc/mode-button.md From 370e81321fe485a94560b4debe2ce7044c99e86f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:15:49 +0100 Subject: [PATCH 164/273] mod/notification-email: add dependencies on device-mode --- mod/notification-email.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index ca23550..404e74d 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, email, scheduler # # send notifications via e-mail # https://rsc.eworm.de/doc/mod/notification-email.md From 9a12934202c1bf8f46b326b37e7b06d84609c4ce Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:21:57 +0100 Subject: [PATCH 165/273] mod/notification-matrix: add dependencies on device-mode --- mod/notification-matrix.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index aee231d..9b2b641 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -5,6 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch, scheduler # # send notifications via Matrix # https://rsc.eworm.de/doc/mod/notification-matrix.md From 9f2f54b4790659189c60e72918cc200625c22d25 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:22:08 +0100 Subject: [PATCH 166/273] mod/notification-ntfy: add dependencies on device-mode --- mod/notification-ntfy.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index df252bb..212fde2 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch, scheduler # # send notifications via Ntfy (ntfy.sh) # https://rsc.eworm.de/doc/mod/notification-ntfy.md From 378a8978dfb86f1f690732cc0e513330282bcd98 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:22:22 +0100 Subject: [PATCH 167/273] mod/notification-telegram: add dependencies on device-mode --- mod/notification-telegram.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index a20367c..c3ef2dd 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch, scheduler # # send notifications via Telegram # https://rsc.eworm.de/doc/mod/notification-telegram.md From 59c9d0ce4bf97407a5f35d8556ecc9f4f03ca752 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:22:43 +0100 Subject: [PATCH 168/273] mod/scriptrunonce: add dependencies on device-mode --- mod/scriptrunonce.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index cae2b05..e5368c4 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, fetch # # download script and run it once # https://rsc.eworm.de/doc/mod/scriptrunonce.md From 3ef458860153ab858eec70e0899efa91a84236d4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:22:55 +0100 Subject: [PATCH 169/273] netwatch-dns: add dependencies on device-mode --- netwatch-dns.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index e05c3ac..467d636 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.16 +# requires device-mode, fetch # # monitor and manage dns/doh with netwatch # https://rsc.eworm.de/doc/netwatch-dns.md From 8dc1e1ea6bdb815de28823dfa43d1cfeda67379f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:32:17 +0100 Subject: [PATCH 170/273] packages-update: add dependencies on device-mode --- packages-update.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages-update.rsc b/packages-update.rsc index 9971e47..ff47b2a 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, scheduler # # download packages and reboot for installation # https://rsc.eworm.de/doc/packages-update.md From ef48b8d39ebacf2bd1c560c6dea33399a9a47b47 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:23:58 +0100 Subject: [PATCH 171/273] telegram-chat: add dependencies on device-mode --- telegram-chat.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index dcdbefa..8f29d8c 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 +# requires device-mode, fetch # # use Telegram to chat with your Router and send commands # https://rsc.eworm.de/doc/telegram-chat.md From 9421566352041654e1f2ded815739b040eec1df4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:28:40 +0100 Subject: [PATCH 172/273] unattended-lte-firmware-upgrade: add dependencies on device-mode --- unattended-lte-firmware-upgrade.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc index c7df92f..74495d1 100644 --- a/unattended-lte-firmware-upgrade.rsc +++ b/unattended-lte-firmware-upgrade.rsc @@ -4,6 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.14 +# requires device-mode, scheduler # # schedule unattended lte firmware upgrade # https://rsc.eworm.de/doc/unattended-lte-firmware-upgrade.md From d921af9a6bda54da74f6b7520db1a8e5697c8c3e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 10:23:06 +0100 Subject: [PATCH 173/273] update-tunnelbroker: add dependencies on device-mode --- update-tunnelbroker.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index c47a45f..a58589b 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -6,6 +6,7 @@ # # provides: ppp-on-up # requires RouterOS, version=7.14 +# requires device-mode, fetch # # update local address of tunnelbroker interface # https://rsc.eworm.de/doc/update-tunnelbroker.md From 8b19e74736693483faf533fd22fce458ae4fac9e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 21:58:47 +0100 Subject: [PATCH 174/273] global-functions: $ScriptInstallUpdate: resolve nested conditions... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and check one after another in a do-block. This uses `:error` as poor man's continue. đŸ¤Ē --- global-functions.rsc | 97 ++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 7d65f45..befe8f0 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1109,52 +1109,59 @@ } } - :if ([ :len $SourceNew ] > 0) do={ - :local SourceCRLF [ :tocrlf $SourceNew ]; - :if ($SourceNew != $ScriptVal->"source" && $SourceCRLF != $ScriptVal->"source") do={ - :if ([ :pick $SourceNew 0 18 ] = "#!rsc by RouterOS\n") do={ - :local Required ([ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires RouterOS, ") ] ]->"version"); - :if ([ $RequiredRouterOS $0 [ $EitherOr $Required "0.0" ] false ] = true) do={ - :local RequiredDM [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires device-mode, ") ] ]; - :local MissingDM ({}); - :foreach Feature,Value in=$RequiredDM do={ - :if ([ :typeof ($DeviceMode->$Feature) ] = "bool" && ($DeviceMode->$Feature) = false) do={ - :set MissingDM ($MissingDM, $Feature); - } - } - :if ([ :len $MissingDM ] = 0) do={ - :if ([ $ValidateSyntax $SourceNew ] = true) do={ - $LogPrint info $0 ("Updating script: " . $ScriptVal->"name"); - /system/script/set owner=($ScriptVal->"name") \ - source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script; - :if ($ScriptVal->"name" = "global-config") do={ - :set ReloadGlobalConfig true; - } - :if ($ScriptVal->"name" = "global-functions" || $ScriptVal->"name" ~ ("^mod/.")) do={ - :set ReloadGlobalFunctions true; - } - } else={ - $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . \ - "' failed! Ignoring!"); - } - } else={ - $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires disabled " . \ - "device-mode features (" . [ :tostr $MissingDM ] . "). Ignoring!"); - } - } else={ - $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \ - $Required . ", which is not met by your installation. Ignoring!"); - } - } else={ - $LogPrint warning $0 ("Looks like new script '" . $ScriptVal->"name" . \ - "' is not valid (missing shebang). Ignoring!"); - } - } else={ - $LogPrint debug $0 ("Script '" . $ScriptVal->"name" . "' did not change."); + :do { + :if ([ :len $SourceNew ] = 0) do={ + $LogPrint debug $0 ("No update for script '" . $ScriptVal->"name" . "'."); + :error false; } - } else={ - $LogPrint debug $0 ("No update for script '" . $ScriptVal->"name" . "'."); - } + + :local SourceCRLF [ :tocrlf $SourceNew ]; + :if ($SourceNew = $ScriptVal->"source" || $SourceCRLF = $ScriptVal->"source") do={ + $LogPrint debug $0 ("Script '" . $ScriptVal->"name" . "' did not change."); + :error false; + } + + :if ([ :pick $SourceNew 0 18 ] != "#!rsc by RouterOS\n") do={ + $LogPrint warning $0 ("Looks like new script '" . $ScriptVal->"name" . \ + "' is not valid (missing shebang). Ignoring!"); + :error false; + } + + :local RequiredROS ([ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires RouterOS, ") ] ]->"version"); + :if ([ $RequiredRouterOS $0 [ $EitherOr $RequiredROS "0.0" ] false ] = false) do={ + $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \ + $RequiredROS . ", which is not met by your installation. Ignoring!"); + :error false; + } + + :local RequiredDM [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires device-mode, ") ] ]; + :local MissingDM ({}); + :foreach Feature,Value in=$RequiredDM do={ + :if ([ :typeof ($DeviceMode->$Feature) ] = "bool" && ($DeviceMode->$Feature) = false) do={ + :set MissingDM ($MissingDM, $Feature); + } + } + :if ([ :len $MissingDM ] > 0) do={ + $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires disabled " . \ + "device-mode features (" . [ :tostr $MissingDM ] . "). Ignoring!"); + :error false; + } + + :if ([ $ValidateSyntax $SourceNew ] = false) do={ + $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . "' failed! Ignoring!"); + :error false; + } + + $LogPrint info $0 ("Updating script: " . $ScriptVal->"name"); + /system/script/set owner=($ScriptVal->"name") \ + source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script; + :if ($ScriptVal->"name" = "global-config") do={ + :set ReloadGlobalConfig true; + } + :if ($ScriptVal->"name" = "global-functions" || $ScriptVal->"name" ~ ("^mod/.")) do={ + :set ReloadGlobalFunctions true; + } + } on-error={ } } :if ($ReloadGlobalFunctions = true) do={ From 414c83ef814af82d53f5b4de3a8d6b5a004704c1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jan 2025 22:07:06 +0100 Subject: [PATCH 175/273] global-functions: $ScriptInstallUpdate: resolve more nested conditions Just like the previous one. --- global-functions.rsc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index befe8f0..a2ec833 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1221,18 +1221,24 @@ :if ([ :len $GlobalConfigMigration ] > 0) do={ :for I from=($ExpectedConfigVersionBefore + 1) to=$ExpectedConfigVersion do={ :local Migration ($GlobalConfigMigration->[ :tostr $I ]); - :if ([ :typeof $Migration ] = "str") do={ - :if ([ $ValidateSyntax $Migration ] = true) do={ - $LogPrint info $0 ("Applying migration for change " . $I . ": " . $Migration); - :do { - [ :parse $Migration ]; - } on-error={ - $LogPrint warning $0 ("Migration code for change " . $I . " failed to run!"); - } - } else={ - $LogPrint warning $0 ("Migration code for change " . $I . " failed syntax validation!"); + :do { + :if ([ :typeof $Migration ] != "str") do={ + $LogPrint debug $0 ("Migration code for change " . $I . " is not available."); + :error false; } - } + + :if ([ $ValidateSyntax $Migration ] = false) do={ + $LogPrint warning $0 ("Migration code for change " . $I . " failed syntax validation!"); + :error false; + } + + $LogPrint info $0 ("Applying migration for change " . $I . ": " . $Migration); + :do { + [ :parse $Migration ]; + } on-error={ + $LogPrint warning $0 ("Migration code for change " . $I . " failed to run!"); + } + } on-error={ } } } From aa294b4c67d038eae1b4e785dfd934176a1fb704 Mon Sep 17 00:00:00 2001 From: Miquel Bonastre Date: Thu, 30 Jan 2025 20:27:14 +0100 Subject: [PATCH 176/273] certs: fix curl false positives... ... when default capath contains system certs If curl has a default capath (debian 12 capath=/etc/ssl/certs) it will add those certs and return ok to any valid https url, defeating the intended use of the cacert option in the Makefile that validates sites and certs. To avoid that, adding option "--capath /dev/null" overrides the default value, if any. Closes: https://github.com/eworm-de/routeros-scripts/pull/88 --- certs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certs/Makefile b/certs/Makefile index 870cb54..b5f6a92 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -29,4 +29,4 @@ DOMAINS = \ all: $(DOMAINS) $(DOMAINS): - curl --output /dev/null --silent --connect-timeout 5 --cacert $(notdir $@).pem https://$(dir $@) + curl --output /dev/null --silent --connect-timeout 5 --capath /dev/null --cacert $(notdir $@).pem https://$(dir $@) From fcb5347e3398dd8c77c44904a4bf0cefc57f3174 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Jan 2025 22:16:49 +0100 Subject: [PATCH 177/273] certs: split checks for dual, ipv4 & ipv6... ... and check both if available. --- certs/Makefile | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/certs/Makefile b/certs/Makefile index b5f6a92..87b4feb 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -1,32 +1,52 @@ # Makefile to check certificates -DOMAINS = \ - 1.1.1.1/DigiCert-Global-Root-G2 \ - 8.8.8.8/GTS-Root-R1 \ - 9.9.9.9/DigiCert-Global-Root-G3 \ +CURL = curl \ + --capath /dev/null \ + --connect-timeout 5 \ + --output /dev/null \ + --silent + +DOMAINS_DUAL = \ api.macvendors.com/GTS-Root-R4 \ - api.mullvad.net/ISRG-Root-X1 \ api.telegram.org/Go-Daddy-Root-Certificate-Authority-G2 \ cloudflare-dns.com/DigiCert-Global-Root-G2 \ dns.google/GTS-Root-R1 \ dns.quad9.net/DigiCert-Global-Root-G3 \ - feodotracker.abuse.ch/GlobalSign \ git.eworm.de/ISRG-Root-X2 \ - ipv4.showipv6.de/ISRG-Root-X1 \ - ipv4.tunnelbroker.net/Starfield-Root-Certificate-Authority-G2 \ - ipv6.showipv6.de/ISRG-Root-X1 \ lists.blocklist.de/Certum-Trusted-Network-CA \ matrix.org/GTS-Root-R4 \ + raw.githubusercontent.com/DigiCert-Global-Root-G2 \ + rsc.eworm.de/ISRG-Root-X2 \ + upgrade.mikrotik.com/ISRG-Root-X1 +DOMAINS_IPV4 = \ + 1.1.1.1/DigiCert-Global-Root-G2 \ + 8.8.8.8/GTS-Root-R1 \ + 9.9.9.9/DigiCert-Global-Root-G3 \ + api.mullvad.net/ISRG-Root-X1 \ + feodotracker.abuse.ch/GlobalSign \ + ipv4.showipv6.de/ISRG-Root-X1 \ + ipv4.tunnelbroker.net/Starfield-Root-Certificate-Authority-G2 \ mkcert.org/ISRG-Root-X1 \ ntfy.sh/ISRG-Root-X1 \ sslbl.abuse.ch/GlobalSign \ - upgrade.mikrotik.com/ISRG-Root-X1 \ www.dshield.org/ISRG-Root-X1 \ www.spamhaus.org/GTS-Root-R4 +DOMAINS_IPV6 = \ + [2606\:4700\:4700\:\:1111]/DigiCert-Global-Root-G2 \ + [2001\:4860\:4860\:\:8888]/GTS-Root-R1 \ + [2620\:fe\:\:9]/DigiCert-Global-Root-G3 \ + ipv6.showipv6.de/ISRG-Root-X1 -.PHONY: $(DOMAINS) +.PHONY: $(DOMAINS_DUAL) $(DOMAINS_IPV4) $(DOMAINS_IPV6) -all: $(DOMAINS) +all: $(DOMAINS_DUAL) $(DOMAINS_IPV4) $(DOMAINS_IPV6) -$(DOMAINS): - curl --output /dev/null --silent --connect-timeout 5 --capath /dev/null --cacert $(notdir $@).pem https://$(dir $@) +$(DOMAINS_DUAL): + $(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@) + $(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@) + +$(DOMAINS_IPV4): + $(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@) + +$(DOMAINS_IPV6): + $(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@) From 87fb70534f8d86509505185f787118c64b3924ba Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Jan 2025 22:25:55 +0100 Subject: [PATCH 178/273] certs: support checking ipv4 or ipv6 only Just run for IPv4 only: make NOIPV6=1 ... or for IPv6 only: make NOIPV4=1 --- certs/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/certs/Makefile b/certs/Makefile index 87b4feb..5dfb0d1 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -42,11 +42,19 @@ DOMAINS_IPV6 = \ all: $(DOMAINS_DUAL) $(DOMAINS_IPV4) $(DOMAINS_IPV6) $(DOMAINS_DUAL): +ifndef NOIPV4 $(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@) +endif +ifndef NOIPV6 $(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@) +endif $(DOMAINS_IPV4): +ifndef NOIPV4 $(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@) +endif $(DOMAINS_IPV6): +ifndef NOIPV6 $(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@) +endif From 0eb91b6bfa8e22f24f0be8052ae2b93c0114ae59 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Jan 2025 22:30:57 +0100 Subject: [PATCH 179/273] update list of contributors --- CONTRIBUTIONS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index ed1d6fa..ef1bd8b 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -22,6 +22,7 @@ for details! * [Daniel Ziegenberg](mailto:daniel@ziegenberg.at) (@ziegenberg) * [Ignacio Serrano](mailto:ignic@ignic.com) (@ignic) * [Michael Gisbers](mailto:michael@gisbers.de) (@mgisbers) +* [Miquel Bonastre](mailto:mbonastre@yahoo.com) (@mbonastre) * @netravnen * [netztrip](mailto:dave-tvg@netztrip.de) (@netztrip) * [Stefan MÃŧller](mailto:stefan.mueller.83@gmail.com) (@PackElend) From 44d0c852f11cce04139a25613822f103e39e06b1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 31 Jan 2025 11:39:51 +0100 Subject: [PATCH 180/273] check-certificates: try with "star." for renewal with wildcards --- check-certificates.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check-certificates.rsc b/check-certificates.rsc index 4271e00..a61cf81 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -158,6 +158,10 @@ :if ($ImportSuccess = false) do={ :set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ]; :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ]; + :if ($ImportSuccess = false && [ :pick $LastName 0 ] = "*") do={ + :set LastName ("star." . [ :pick $LastName 2 [ :len $LastName ] ]); + :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ]; + } } } :if ($ImportSuccess = false) do={ :error false; } From 75e5ddec527ac505540306ca5b26b7c40cdb1b5d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 31 Jan 2025 13:09:22 +0100 Subject: [PATCH 181/273] check-certificates: do not rename the wrong certificate --- check-certificates.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index a61cf81..2900a83 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -68,8 +68,10 @@ $LogPrint warning $ScriptName ("Decryption failed for certificate file '" . $CertFileName . "'."); } - :foreach CertInChain in=[ /certificate/find where name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \ - common-name!=$Name !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) !(common-name=[]) ] do={ + :foreach CertInChain in=[ /certificate/find where common-name!=$Name !private-key \ + name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \ + !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) \ + !(common-name=[]) ] do={ $CertificateNameByCN [ /certificate/get $CertInChain common-name ]; } From eabe3f6e951010ff9c112d82ee27bc39e3786960 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 31 Jan 2025 21:33:57 +0100 Subject: [PATCH 182/273] check-certificates: pass real and modified name into function --- check-certificates.rsc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 2900a83..b986179 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -34,7 +34,8 @@ :local CheckCertificatesDownloadImport do={ :local ScriptName [ :tostr $1 ]; - :local Name [ :tostr $2 ]; + :local CertName [ :tostr $2 ]; + :local FetchName [ :tostr $3 ]; :global CertRenewUrl; :global CertRenewPass; @@ -49,7 +50,7 @@ :local Return false; :foreach Type in={ ".pem"; ".p12" } do={ - :local CertFileName ([ $UrlEncode $Name ] . $Type); + :local CertFileName ([ $UrlEncode $FetchName ] . $Type); :do { /tool/fetch check-certificate=yes-without-crl http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \ ($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value; @@ -68,9 +69,9 @@ $LogPrint warning $ScriptName ("Decryption failed for certificate file '" . $CertFileName . "'."); } - :foreach CertInChain in=[ /certificate/find where common-name!=$Name !private-key \ + :foreach CertInChain in=[ /certificate/find where common-name!=$CertName !private-key \ name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \ - !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) \ + !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $CertName ] . "(\\W|\$)")) \ !(common-name=[]) ] do={ $CertificateNameByCN [ /certificate/get $CertInChain common-name ]; } @@ -145,6 +146,7 @@ :foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={ :local CertVal [ /certificate/get $Cert ]; :local LastName; + :local FetchName; :do { :if ([ :len $CertRenewUrl ] = 0) do={ @@ -155,14 +157,16 @@ :local ImportSuccess false; :set LastName ($CertVal->"common-name"); - :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ]; + :set FetchName $LastName; + :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ]; :foreach SAN in=($CertVal->"subject-alt-name") do={ :if ($ImportSuccess = false) do={ :set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ]; - :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ]; + :set FetchName $LastName; + :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ]; :if ($ImportSuccess = false && [ :pick $LastName 0 ] = "*") do={ - :set LastName ("star." . [ :pick $LastName 2 [ :len $LastName ] ]); - :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ]; + :set FetchName ("star." . [ :pick $LastName 2 [ :len $LastName ] ]); + :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ]; } } } @@ -174,7 +178,7 @@ } else={ $LogPrint debug $ScriptName ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced."); - :local CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ $UrlEncode $LastName ] ] . "\\.(p12|pem)_[0-9]+\$") \ + :local CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ $UrlEncode $FetchName ] ] . "\\.(p12|pem)_[0-9]+\$") \ (common-name=($CertVal->"common-name") or subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $LastName ] . "(\\W|\$)")) \ fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>$CertRenewTime ]; :local CertNewVal [ /certificate/get $CertNew ]; From 3ad7ccd3d6c443bf64156ffcd980a418584c35d1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Feb 2025 10:05:35 +0100 Subject: [PATCH 183/273] check-certificates: check to characters for star-dot --- check-certificates.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index b986179..34e7537 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -164,7 +164,7 @@ :set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ]; :set FetchName $LastName; :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ]; - :if ($ImportSuccess = false && [ :pick $LastName 0 ] = "*") do={ + :if ($ImportSuccess = false && [ :pick $LastName 0 2 ] = "*.") do={ :set FetchName ("star." . [ :pick $LastName 2 [ :len $LastName ] ]); :set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ]; } From 61f3c26199b4c22ae312a09f6c82f8e9cc403dd0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Feb 2025 14:35:47 +0100 Subject: [PATCH 184/273] doc/check-health: highligh note on bad initial state --- doc/check-health.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/check-health.md b/doc/check-health.md index 578ea43..a945371 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -26,14 +26,16 @@ health related events: * power supply failed or recovered * temperature is above or below threshold -Note that bad initial state will not trigger an event. - Monitoring CPU and RAM utilization (available processing and memory resources) works on all devices. Other than that only sensors available in hardware can be checked. See what your hardware supports: /system/health/print; +> âš ī¸ **Warning**: Note that bad initial state will not trigger an event! For +> example rebooting a device that is already too hot will not trigger an +> alert on high temperature. + ### Sample notifications #### CPU utilization From 3024b246b58fa106592c7f6f949e421e15edcdb3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 4 Feb 2025 12:02:31 +0100 Subject: [PATCH 185/273] check-health: remove extra line break --- check-health.rsc | 1 - 1 file changed, 1 deletion(-) diff --git a/check-health.rsc b/check-health.rsc index 31bd6c2..76de4cb 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -91,7 +91,6 @@ :set CheckHealthTemperatureNotified ({}); } - :foreach Voltage in=[ /system/health/find where type="V" ] do={ :local Name [ /system/health/get $Voltage name ]; :local Value [ /system/health/get $Voltage value ]; From bfe5f20920a90fc54b7b25a238a1763fa6f2d5e7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 4 Feb 2025 15:08:37 +0100 Subject: [PATCH 186/273] check-health: remove trailing whitespaces --- check-health.rsc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/check-health.rsc b/check-health.rsc index 76de4cb..34c508c 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -107,16 +107,16 @@ message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ [ $FormatLine "old value" ($CheckHealthLast->$Name . " V") 12 ] . "\n" . \ [ $FormatLine "new value" ($Value . " V") 12 ]) }); - } else={ - :if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \ - message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") }); - } - :if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \ - message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") }); + } else={ + :if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$ScriptName; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") }); + } + :if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$ScriptName; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") }); } } } From 6501c98c822af958588512c374474f16bac61493 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Feb 2025 09:36:15 +0100 Subject: [PATCH 187/273] certs: dns.google switched to 'GTS Root R4' Note that 8.8.8.8 is still at 'GTS Root R1'... --- certs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certs/Makefile b/certs/Makefile index 5dfb0d1..ba25303 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -10,7 +10,7 @@ DOMAINS_DUAL = \ api.macvendors.com/GTS-Root-R4 \ api.telegram.org/Go-Daddy-Root-Certificate-Authority-G2 \ cloudflare-dns.com/DigiCert-Global-Root-G2 \ - dns.google/GTS-Root-R1 \ + dns.google/GTS-Root-R4 \ dns.quad9.net/DigiCert-Global-Root-G3 \ git.eworm.de/ISRG-Root-X2 \ lists.blocklist.de/Certum-Trusted-Network-CA \ From 27c92b4382f961ad427313f6a0bfc01716e805d1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Feb 2025 09:51:42 +0100 Subject: [PATCH 188/273] doc/netwatch-dns: switch exmample to cloudflare-dns.com --- doc/netwatch-dns.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/netwatch-dns.md b/doc/netwatch-dns.md index 6d2c865..aa4e91f 100644 --- a/doc/netwatch-dns.md +++ b/doc/netwatch-dns.md @@ -53,8 +53,8 @@ Note that using a name in DoH url may introduce a chicken-and-egg issue! Adding a static DNS record has the same result for the url, but always resolves to the same address. - /ip/dns/static/add name="dns.nextdns.io" address=199.247.16.158; - /tool/netwatch/add comment="doh" host=199.247.16.158; + /ip/dns/static/add name="cloudflare-dns.com" address=1.1.1.1; + /tool/netwatch/add comment="doh" host=1.1.1.1; Be aware that you have to keep the ip address in sync with real world manually! From 84ba3a463a46876f3e728326034d404d02aefb67 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Feb 2025 09:55:41 +0100 Subject: [PATCH 189/273] doc/netwatch-dns: warn on different certificate... ... based on indicated server name. Currently this is true for 8.8.8.8 (GTS Root R1) and dns.google (GTS Root R4). --- doc/netwatch-dns.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/netwatch-dns.md b/doc/netwatch-dns.md index aa4e91f..0d94918 100644 --- a/doc/netwatch-dns.md +++ b/doc/netwatch-dns.md @@ -66,6 +66,10 @@ Importing a certificate automatically is possible. You may want to find the /tool/netwatch/add comment="doh, doh-cert=DigiCert Global Root G3" host=9.9.9.9; /tool/netwatch/add comment="doh, doh-cert=GTS Root R1" host=8.8.8.8; +> âš ī¸ **Warning**: Combining these techniques can cause some confusion and +> troubles! Chances are that a service uses different certificates based +> on indicated server name. + Sometimes using just one specific (possibly internal) DNS server may be desired, with fallback in case it fails. This is possible as well: From 23d38927bcd553229d1cd80bff0d3506ab40f6fa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 4 Feb 2025 12:27:35 +0100 Subject: [PATCH 190/273] check-health: split off plugins... ... from 'check-health', so the script works on all devices to monitor CPU and RAM. The supported plugins for sensors in hardware are installed automatically. --- check-health.d/state.rsc | 48 ++++++++ check-health.d/temperature.rsc | 74 ++++++++++++ check-health.d/voltage.rsc | 63 ++++++++++ check-health.rsc | 108 +++--------------- ...l.avif => notification-08-state-fail.avif} | Bin ...-ok.avif => notification-09-state-ok.avif} | Bin doc/check-health.md | 42 +++++-- global-functions.rsc | 2 +- news-and-changes.rsc | 2 + 9 files changed, 239 insertions(+), 100 deletions(-) create mode 100644 check-health.d/state.rsc create mode 100644 check-health.d/temperature.rsc create mode 100644 check-health.d/voltage.rsc rename doc/check-health.d/{notification-08-psu-fail.avif => notification-08-state-fail.avif} (100%) rename doc/check-health.d/{notification-09-psu-ok.avif => notification-09-state-ok.avif} (100%) diff --git a/check-health.d/state.rsc b/check-health.d/state.rsc new file mode 100644 index 0000000..bcc1fbc --- /dev/null +++ b/check-health.d/state.rsc @@ -0,0 +1,48 @@ +#!rsc by RouterOS +# RouterOS script: check-health.d/state +# Copyright (c) 2019-2025 Christian Hesse +# https://rsc.eworm.de/COPYING.md +# +# requires RouterOS, version=7.14 +# +# check for RouterOS health state - state plugin +# https://rsc.eworm.de/doc/check-health.md + +:global CheckHealthPlugins; + +:set ($CheckHealthPlugins->[ :jobname ]) do={ + :local FuncName [ :tostr $0 ]; + + :global CheckHealthLast; + :global Identity; + + :global LogPrint; + :global SendNotification2; + :global SymbolForNotification; + + :if ([ :len [ /system/health/find where type="" name~"-state\$"] ] = 0) do={ + $LogPrint debug $FuncName ("Your device does not provide any state health values."); + :return false; + } + + :foreach State in=[ /system/health/find where type="" name~"-state\$" ] do={ + :local Name [ /system/health/get $State name ]; + :local Value [ /system/health/get $State value ]; + + :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ + :if ($CheckHealthLast->$Name = "ok" && \ + $Value != "ok") do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "cross-mark" ] . "Health warning: " . $Name); \ + message=("The device '" . $Name . "' on " . $Identity . " failed!") }); + } + :if ($CheckHealthLast->$Name != "ok" && \ + $Value = "ok") do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \ + message=("The device '" . $Name . "' on " . $Identity . " recovered!") }); + } + } + :set ($CheckHealthLast->$Name) $Value; + } +} diff --git a/check-health.d/temperature.rsc b/check-health.d/temperature.rsc new file mode 100644 index 0000000..9b84782 --- /dev/null +++ b/check-health.d/temperature.rsc @@ -0,0 +1,74 @@ +#!rsc by RouterOS +# RouterOS script: check-health.d/temperature +# Copyright (c) 2019-2025 Christian Hesse +# https://rsc.eworm.de/COPYING.md +# +# requires RouterOS, version=7.14 +# +# check for RouterOS health state - temperature plugin +# https://rsc.eworm.de/doc/check-health.md + +:global CheckHealthPlugins; + +:set ($CheckHealthPlugins->[ :jobname ]) do={ + :local FuncName [ :tostr $0 ]; + + :global CheckHealthLast; + :global CheckHealthTemperature; + :global CheckHealthTemperatureDeviation; + :global CheckHealthTemperatureNotified; + :global Identity; + + :global LogPrint; + :global SendNotification2; + :global SymbolForNotification; + + :if ([ :len [ /system/health/find where type="C" ] ] = 0) do={ + $LogPrint debug $FuncName ("Your device does not provide any voltage health values."); + :return false; + } + + :local TempToNum do={ + :global CharacterReplace; + :local T [ :toarray [ $CharacterReplace $1 "." "," ] ]; + :return ($T->0 * 10 + $T->1); + } + + :if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ + :set CheckHealthTemperatureNotified ({}); + } + + :foreach Temperature in=[ /system/health/find where type="C" ] do={ + :local Name [ /system/health/get $Temperature name ]; + :local Value [ /system/health/get $Temperature value ]; + + :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ + :if ([ :typeof ($CheckHealthTemperature->$Name) ] != "num" ) do={ + $LogPrint info $FuncName ("No threshold given for " . $Name . ", assuming 50C."); + :set ($CheckHealthTemperature->$Name) 50; + } + :local Validate [ /system/health/get [ find where name=$Name ] value ]; + :while ($Value != $Validate) do={ + :set Value $Validate; + :set Validate [ /system/health/get [ find where name=$Name ] value ]; + } + :if ($Value > $CheckHealthTemperature->$Name && \ + $CheckHealthTemperatureNotified->$Name != true) do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \ + message=("The " . $Name . " on " . $Identity . " is above threshold: " . \ + $Value . "\C2\B0" . "C") }); + :set ($CheckHealthTemperatureNotified->$Name) true; + } + :if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \ + $CheckHealthTemperatureNotified->$Name = true) do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \ + message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \ + $Value . "\C2\B0" . "C") }); + :set ($CheckHealthTemperatureNotified->$Name) false; + } + } + :set ($CheckHealthLast->$Name) $Value; + } +} diff --git a/check-health.d/voltage.rsc b/check-health.d/voltage.rsc new file mode 100644 index 0000000..6394795 --- /dev/null +++ b/check-health.d/voltage.rsc @@ -0,0 +1,63 @@ +#!rsc by RouterOS +# RouterOS script: check-health.d/voltage +# Copyright (c) 2019-2025 Christian Hesse +# https://rsc.eworm.de/COPYING.md +# +# requires RouterOS, version=7.14 +# +# check for RouterOS health state - voltage plugin +# https://rsc.eworm.de/doc/check-health.md + +:global CheckHealthPlugins; + +:set ($CheckHealthPlugins->[ :jobname ]) do={ + :local FuncName [ :tostr $0 ]; + + :global CheckHealthLast; + :global CheckHealthVoltageLow; + :global CheckHealthVoltagePercent; + :global Identity; + + :global FormatLine; + :global IfThenElse; + :global LogPrint; + :global SendNotification2; + :global SymbolForNotification; + + :if ([ :len [ /system/health/find where type="V" ] ] = 0) do={ + $LogPrint debug $FuncName ("Your device does not provide any voltage health values."); + :return false; + } + + :foreach Voltage in=[ /system/health/find where type="V" ] do={ + :local Name [ /system/health/get $Voltage name ]; + :local Value [ /system/health/get $Voltage value ]; + + :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ + :local NumCurr [ $TempToNum $Value ]; + :local NumLast [ $TempToNum ($CheckHealthLast->$Name) ]; + + :if ($NumLast * (100 + $CheckHealthVoltagePercent) < $NumCurr * 100 || \ + $NumLast * 100 > $NumCurr * (100 + $CheckHealthVoltagePercent)) do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \ + $NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \ + message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ + [ $FormatLine "old value" ($CheckHealthLast->$Name . " V") 12 ] . "\n" . \ + [ $FormatLine "new value" ($Value . " V") 12 ]) }); + } else={ + :if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") }); + } + :if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$FuncName; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") }); + } + } + } + :set ($CheckHealthLast->$Name) $Value; + } +} diff --git a/check-health.rsc b/check-health.rsc index 34c508c..827f597 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -19,11 +19,6 @@ :global CheckHealthCPUUtilizationNotified; :global CheckHealthLast; :global CheckHealthRAMUtilizationNotified; - :global CheckHealthTemperature; - :global CheckHealthTemperatureDeviation; - :global CheckHealthTemperatureNotified; - :global CheckHealthVoltageLow; - :global CheckHealthVoltagePercent; :global Identity; :global FormatLine; @@ -33,6 +28,7 @@ :global ScriptLock; :global SendNotification2; :global SymbolForNotification; + :global ValidateSyntax; :local TempToNum do={ :global CharacterReplace; @@ -78,105 +74,37 @@ :set CheckHealthRAMUtilizationNotified false; } - :if ([ :len [ /system/health/find ] ] = 0) do={ - $LogPrint debug $ScriptName ("Your device does not provide any health values."); + :local Plugins [ /system/script/find where name~"^check-health.d/." ]; + :if ([ :len $Plugins ] = 0) do={ + $LogPrint debug $ScriptName ("No plugins installed."); :set ExitOK true; :error true; } + :global CheckHealthPlugins ({}); :if ([ :typeof $CheckHealthLast ] != "array") do={ :set CheckHealthLast ({}); } - :if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ - :set CheckHealthTemperatureNotified ({}); - } - :foreach Voltage in=[ /system/health/find where type="V" ] do={ - :local Name [ /system/health/get $Voltage name ]; - :local Value [ /system/health/get $Voltage value ]; - - :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ - :local NumCurr [ $TempToNum $Value ]; - :local NumLast [ $TempToNum ($CheckHealthLast->$Name) ]; - - :if ($NumLast * (100 + $CheckHealthVoltagePercent) < $NumCurr * 100 || \ - $NumLast * 100 > $NumCurr * (100 + $CheckHealthVoltagePercent)) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \ - $NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \ - message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ - [ $FormatLine "old value" ($CheckHealthLast->$Name . " V") 12 ] . "\n" . \ - [ $FormatLine "new value" ($Value . " V") 12 ]) }); - } else={ - :if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \ - message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") }); - } - :if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \ - message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") }); - } + :foreach Plugin in=$Plugins do={ + :local PluginVal [ /system/script/get $Plugin ]; + :if ([ $ValidateSyntax ($PluginVal->"source") ] = true) do={ + :do { + /system/script/run $Plugin; + } on-error={ + $LogPrint error $ScriptName ("Plugin '" . $ScriptVal->"name" . "' failed to run."); } + } else={ + $LogPrint error $ScriptName ("Plugin '" . $ScriptVal->"name" . "' failed syntax validation, skipping."); } - :set ($CheckHealthLast->$Name) $Value; } - :foreach PSU in=[ /system/health/find where name~"^psu.*-state\$" ] do={ - :local Name [ /system/health/get $PSU name ]; - :local Value [ /system/health/get $PSU value ]; - - :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ - :if ($CheckHealthLast->$Name = "ok" && \ - $Value != "ok") do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "cross-mark" ] . "Health warning: " . $Name); \ - message=("The power supply unit '" . $Name . "' on " . $Identity . " failed!") }); - } - :if ($CheckHealthLast->$Name != "ok" && \ - $Value = "ok") do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \ - message=("The power supply unit '" . $Name . "' on " . $Identity . " recovered!") }); - } - } - :set ($CheckHealthLast->$Name) $Value; + :foreach PluginName,Discard in=$CheckHealthPlugins do={ + ($CheckHealthPlugins->$PluginName) \ + ("\$CheckHealthPlugins->\"" . $PluginName . "\""); } - :foreach Temperature in=[ /system/health/find where type="C" ] do={ - :local Name [ /system/health/get $Temperature name ]; - :local Value [ /system/health/get $Temperature value ]; - - :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ - :if ([ :typeof ($CheckHealthTemperature->$Name) ] != "num" ) do={ - $LogPrint info $ScriptName ("No threshold given for " . $Name . ", assuming 50C."); - :set ($CheckHealthTemperature->$Name) 50; - } - :local Validate [ /system/health/get [ find where name=$Name ] value ]; - :while ($Value != $Validate) do={ - :set Value $Validate; - :set Validate [ /system/health/get [ find where name=$Name ] value ]; - } - :if ($Value > $CheckHealthTemperature->$Name && \ - $CheckHealthTemperatureNotified->$Name != true) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \ - message=("The " . $Name . " on " . $Identity . " is above threshold: " . \ - $Value . "\C2\B0" . "C") }); - :set ($CheckHealthTemperatureNotified->$Name) true; - } - :if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \ - $CheckHealthTemperatureNotified->$Name = true) do={ - $SendNotification2 ({ origin=$ScriptName; \ - subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \ - message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \ - $Value . "\C2\B0" . "C") }); - :set ($CheckHealthTemperatureNotified->$Name) false; - } - } - :set ($CheckHealthLast->$Name) $Value; - } + :set CheckHealthPlugins; } on-error={ :global ExitError; $ExitError $ExitOK [ :jobname ]; } diff --git a/doc/check-health.d/notification-08-psu-fail.avif b/doc/check-health.d/notification-08-state-fail.avif similarity index 100% rename from doc/check-health.d/notification-08-psu-fail.avif rename to doc/check-health.d/notification-08-state-fail.avif diff --git a/doc/check-health.d/notification-09-psu-ok.avif b/doc/check-health.d/notification-09-state-ok.avif similarity index 100% rename from doc/check-health.d/notification-09-psu-ok.avif rename to doc/check-health.d/notification-09-state-ok.avif diff --git a/doc/check-health.md b/doc/check-health.md index a945371..51e71bc 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -17,21 +17,21 @@ Description ----------- This script is run from scheduler periodically, sending notification on -health related events: +health related events. Monitoring CPU and RAM utilization (available +processing and memory resources) works on all devices: * high CPU utilization * high RAM utilization (low available RAM) + +With additional plugins functionality can be extended, depending on +sensors available in hardware: + * voltage jumps up or down more than configured threshold * voltage drops below hard lower limit +* fan failed or recovered * power supply failed or recovered * temperature is above or below threshold -Monitoring CPU and RAM utilization (available processing and memory -resources) works on all devices. Other than that only sensors available -in hardware can be checked. See what your hardware supports: - - /system/health/print; - > âš ī¸ **Warning**: Note that bad initial state will not trigger an event! For > example rebooting a device that is already too hot will not trigger an > alert on high temperature. @@ -59,8 +59,8 @@ in hardware can be checked. See what your hardware supports: #### PSU state -![check-health notification psu fail](check-health.d/notification-08-psu-fail.avif) -![check-health notification psu ok](check-health.d/notification-09-psu-ok.avif) +![check-health notification state fail](check-health.d/notification-08-state-fail.avif) +![check-health notification state ok](check-health.d/notification-09-state-ok.avif) Requirements and installation ----------------------------- @@ -74,6 +74,30 @@ Just install the script and create a scheduler: > precision of cpu utilization, escpecially on devices with limited > resources. Thus an unusual interval is used here. +### Plugins + +Additional plugins are available for sensors available in hardware. First +check what your hardware supports: + + /system/health/print; + +Then install the plugin for *fan* and *power supply unit* *state*: + + $ScriptInstallUpdate check-health,check-health.d/state; + +... or *temperature*: + + $ScriptInstallUpdate check-health,check-health.d/temperature; + +... or *voltage*: + + $ScriptInstallUpdate check-health,check-health.d/voltage; + +You can also combine the commands and install all or a subset of plugins +in one go: + + $ScriptInstallUpdate check-health,check-health.d/state,check-health.d/temperature,check-health.d/voltage; + Configuration ------------- diff --git a/global-functions.rsc b/global-functions.rsc index a2ec833..8eb6712 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -13,7 +13,7 @@ :local ScriptName [ :jobname ]; # expected configuration version -:global ExpectedConfigVersion 131; +:global ExpectedConfigVersion 132; # global variables not to be changed by user :global GlobalFunctionsReady false; diff --git a/news-and-changes.rsc b/news-and-changes.rsc index 7508b43..c7e566f 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -56,6 +56,7 @@ 129="Extended 'backup-partition' to support RouterOS copy-over - interactively or before feature update."; 130="Dropped intermediate certificates, depending on just root certificates now."; 131="Enhanced certificate download to fallback to mkcert.org, so all (commonly trusted) root certificates are available now."; + 132="Split off plugins from 'check-health', so the script works on all devices to monitor CPU and RAM. The supported plugins for sensors in hardware are installed automatically."; }; # Migration steps to be applied on script updates @@ -64,4 +65,5 @@ 100=":global ScriptInstallUpdate; :if ([ :len [ /system/script/find where name=\"ssh-keys-import\" source~\"^#!rsc by RouterOS\\r?\\n\" ] ] > 0) do={ /system/script/set name=\"mod/ssh-keys-import\" ssh-keys-import; \$ScriptInstallUpdate; }"; 104=":global CharacterReplace; :global ScriptInstallUpdate; :foreach Script in={ \"capsman-download-packages\"; \"capsman-rolling-upgrade\"; \"hotspot-to-wpa\"; \"hotspot-to-wpa-cleanup\" } do={ /system/script/set name=(\$Script . \".capsman\") [ find where name=\$Script ]; :foreach Scheduler in=[ /system/scheduler/find where on-event~(\$Script . \"([^-.]|\\\$)\") ] do={ /system/scheduler/set \$Scheduler on-event=[ \$CharacterReplace [ get \$Scheduler on-event ] \$Script (\$Script . \".capsman\") ]; }; }; /ip/hotspot/user/profile/set on-login=\"hotspot-to-wpa.capsman\" [ find where on-login=\"hotspot-to-wpa\" ]; \$ScriptInstallUpdate;"; 111=":local Rec [ /ip/dns/static/find where comment~\"^managed by dhcp-to-dns for \" ]; :if ([ :len \$Rec ] > 0) do={ /ip/dns/static/remove \$Rec; /system/script/run dhcp-to-dns; }"; + 132=":if ([ :len [ /system/script/find where name=\"check-health\" ] ] > 0) do={ :local Code \":local Install \\\"check-health\\\"; :if ([ :len [ /system/health/find where type=\\\"\\\" name~\\\"-state\\\\\\\$\\\" ] ] > 0) do={ :set Install (\\\$Install . \\\",check-health.d/state\\\"); }; :if ([ :len [ /system/health/find where type=\\\"C\\\" ] ] > 0) do={ :set Install (\\\$Install . \\\",check-health.d/temperature\\\"); }; :if ([ :len [ /system/health/find where type=\\\"V\\\" ] ] > 0) do={ :set Install (\\\$Install . \\\",check-health.d/voltage\\\"); }; :global ScriptInstallUpdate; \\\$ScriptInstallUpdate \\\$Install;\"; :global ValidateSyntax; :if ([ \$ValidateSyntax \$Code ] = true) do={ :do { [ :parse \$Code ]; } on-error={ }; }; }"; }; From 7b660d095293e24bd3fedf2a00815eedec84ccf5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Feb 2025 21:24:20 +0100 Subject: [PATCH 191/273] packages-update: move configuration variables up --- packages-update.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages-update.rsc b/packages-update.rsc index ff47b2a..ba6d4f7 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -16,6 +16,9 @@ :do { :local ScriptName [ :jobname ]; + :global PackagesUpdateDeferReboot; + :global PackagesUpdateBackupFailure; + :global DownloadPackage; :global Grep; :global LogPrint; @@ -24,9 +27,6 @@ :global ScriptLock; :global VersionToNum; - :global PackagesUpdateDeferReboot; - :global PackagesUpdateBackupFailure; - :local Schedule do={ :local ScriptName [ :tostr $1 ]; From dafd95d44a18088771e6e0fd9b2ef115ddbcbc18 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Feb 2025 21:26:39 +0100 Subject: [PATCH 192/273] packages-update: disable random delay for backup --- packages-update.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages-update.rsc b/packages-update.rsc index ba6d4f7..788edd4 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -16,6 +16,7 @@ :do { :local ScriptName [ :jobname ]; + :global BackupRandomDelay; :global PackagesUpdateDeferReboot; :global PackagesUpdateBackupFailure; @@ -79,7 +80,9 @@ :set ($RunOrder->($Store->"order" . "-" . $ScriptVal->"name")) ($ScriptVal->"name"); } + :local BackupRandomDelayBefore $BackupRandomDelay; :foreach Order,Script in=$RunOrder do={ + :set BackupRandomDelay 0; :set PackagesUpdateBackupFailure false; :do { $LogPrint info $ScriptName ("Running backup script " . $Script . " before update."); @@ -87,6 +90,7 @@ } on-error={ :set PackagesUpdateBackupFailure true; } + :set BackupRandomDelay $BackupRandomDelayBefore; :if ($PackagesUpdateBackupFailure = true) do={ $LogPrint warning $ScriptName ("Running backup script " . $Script . " before update failed!"); From dbdc3e4718f5b0ec614baa9a9a942b52cbb19ad4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 17:12:30 +0100 Subject: [PATCH 193/273] packages-update: ignore available packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was introduced with RouterOS 7.18beta2 to list and install available packages. We do not want to install all of them. 😝 --- packages-update.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages-update.rsc b/packages-update.rsc index 788edd4..afec2f5 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -130,7 +130,7 @@ } } - :foreach Package in=[ /system/package/find where !bundle ] do={ + :foreach Package in=[ /system/package/find where !bundle !available ] do={ :local PkgName [ /system/package/get $Package name ]; :if ([ $DownloadPackage $PkgName ($Update->"latest-version") ] = false) do={ $LogPrint error $ScriptName ("Download for package " . $PkgName . " failed, update aborted."); From 0fb5fd03230c2054a94d80ca72fc941e21b7f3ff Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 17:36:59 +0100 Subject: [PATCH 194/273] global-functions: $MkDir: create directory directly... ... instead of file inside directory. This requires RouterOS 7.15, so bumping requirement. --- README.md | 2 +- global-functions.rsc | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8594f58..a76d50f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ RouterOS Scripts [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/global-functions.rsc b/global-functions.rsc index 8eb6712..48f1676 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -4,7 +4,7 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch, scheduler # # global functions @@ -895,10 +895,8 @@ } :do { - :local File ($Path . "/file"); - /file/add name=$File; - $WaitForFile $File; - /file/remove $File; + /file/add type="directory" name=$Path; + $WaitForFile $Path; } on-error={ $LogPrint warning $0 ("Making directory '" . $Path . "' failed!"); :return false; From 4542c2b19e4b74ee37c02671c05f4025946d8bf7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:16:57 +0100 Subject: [PATCH 195/273] global-functions: introduce $RmFile --- global-functions.rsc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 48f1676..e41d352 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -63,6 +63,7 @@ :global ProtocolStrip; :global RandomDelay; :global RequiredRouterOS; +:global RmFile; :global ScriptFromTerminal; :global ScriptInstallUpdate; :global ScriptLock; @@ -1004,6 +1005,26 @@ :return true; } +# remove file +:set RmFile do={ + :local FileName [ :tostr $1 ]; + + :global LogPrint; + + :local File [ /file/find where name=$FileName type=file ]; + :if ([ :len $File ] = 0) do={ + :return true; + } + + :do { + /file/remove $File; + } on-error={ + $LogPrint error $0 ("Removing file '" . $FileName . "' (" . $File . ") failed."); + :return false; + } + :return true; +} + # check if script is run from terminal :set ScriptFromTerminal do={ :local Script [ :tostr $1 ]; From 727495d9c4f7ff00a9d0c5dc1fd06e22ba3abe39 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:21:28 +0100 Subject: [PATCH 196/273] global-functions: introduce $RmDir --- global-functions.rsc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index e41d352..b7a3b6a 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -63,6 +63,7 @@ :global ProtocolStrip; :global RandomDelay; :global RequiredRouterOS; +:global RmDir; :global RmFile; :global ScriptFromTerminal; :global ScriptInstallUpdate; @@ -1005,6 +1006,26 @@ :return true; } +# remove directory +:set RmDir do={ + :local DirName [ :tostr $1 ]; + + :global LogPrint; + + :local Dir [ /file/find where name=$DirName type=directory ]; + :if ([ :len $Dir ] = 0) do={ + :return true; + } + + :do { + /file/remove $Dir; + } on-error={ + $LogPrint error $0 ("Removing directory '" . $DirName . "' (" . $Dir . ") failed."); + :return false; + } + :return true; +} + # remove file :set RmFile do={ :local FileName [ :tostr $1 ]; From 7233dea5bb9e73a93599baf17077b80758934665 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 19:24:38 +0100 Subject: [PATCH 197/273] global-functions: $RmFile: add debug output --- global-functions.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index b7a3b6a..50202f0 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1032,8 +1032,11 @@ :global LogPrint; + $LogPrint debug $0 ("Removing file: ". $FileName); + :local File [ /file/find where name=$FileName type=file ]; :if ([ :len $File ] = 0) do={ + $LogPrint debug $0 ("... which does not exist."); :return true; } From 49d9fb1ffddfb973bed00aac3a36bf4dd8d6687a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 19:24:05 +0100 Subject: [PATCH 198/273] global-functions: $RmDir: add debug output --- global-functions.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 50202f0..2799f39 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1012,8 +1012,11 @@ :global LogPrint; + $LogPrint debug $0 ("Removing directory: ". $DirName); + :local Dir [ /file/find where name=$DirName type=directory ]; :if ([ :len $Dir ] = 0) do={ + $LogPrint debug $0 ("... which does not exist."); :return true; } From 4bfb591fa035a12e80edf8f2550f6237cd343cd9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 17:39:48 +0100 Subject: [PATCH 199/273] bump required RouterOS version for all scripts --- BRANCHES.md | 2 +- CERTIFICATES.md | 2 +- CONTRIBUTIONS.md | 2 +- INITIAL-COMMANDS.md | 2 +- accesslist-duplicates.capsman.rsc | 2 +- accesslist-duplicates.local.rsc | 2 +- accesslist-duplicates.template.rsc | 2 +- accesslist-duplicates.wifi.rsc | 2 +- backup-cloud.rsc | 2 +- backup-email.rsc | 2 +- backup-partition.rsc | 2 +- backup-upload.rsc | 2 +- capsman-download-packages.capsman.rsc | 2 +- capsman-download-packages.template.rsc | 2 +- capsman-download-packages.wifi.rsc | 2 +- capsman-rolling-upgrade.capsman.rsc | 2 +- capsman-rolling-upgrade.template.rsc | 2 +- capsman-rolling-upgrade.wifi.rsc | 2 +- certificate-renew-issued.rsc | 2 +- check-certificates.rsc | 2 +- check-health.d/state.rsc | 2 +- check-health.d/temperature.rsc | 2 +- check-health.d/voltage.rsc | 2 +- check-health.rsc | 2 +- check-lte-firmware-upgrade.rsc | 2 +- check-routeros-update.rsc | 2 +- collect-wireless-mac.capsman.rsc | 2 +- collect-wireless-mac.local.rsc | 2 +- collect-wireless-mac.template.rsc | 2 +- collect-wireless-mac.wifi.rsc | 2 +- dhcp-lease-comment.capsman.rsc | 2 +- dhcp-lease-comment.local.rsc | 2 +- dhcp-lease-comment.template.rsc | 2 +- dhcp-lease-comment.wifi.rsc | 2 +- doc/accesslist-duplicates.md | 2 +- doc/backup-cloud.md | 2 +- doc/backup-email.md | 2 +- doc/backup-partition.md | 2 +- doc/backup-upload.md | 2 +- doc/capsman-download-packages.md | 2 +- doc/capsman-rolling-upgrade.md | 2 +- doc/certificate-renew-issued.md | 2 +- doc/check-certificates.md | 2 +- doc/check-health.md | 2 +- doc/check-lte-firmware-upgrade.md | 2 +- doc/check-routeros-update.md | 2 +- doc/collect-wireless-mac.md | 2 +- doc/dhcp-lease-comment.md | 2 +- doc/firmware-upgrade-reboot.md | 2 +- doc/global-wait.md | 2 +- doc/gps-track.md | 2 +- doc/hotspot-to-wpa.md | 2 +- doc/ip-addr-bridge.md | 2 +- doc/ipsec-to-dns.md | 2 +- doc/ipv6-update.md | 2 +- doc/lease-script.md | 2 +- doc/leds-mode.md | 2 +- doc/log-forward.md | 2 +- doc/mod/bridge-port-to.md | 2 +- doc/mod/bridge-port-vlan.md | 2 +- doc/mod/inspectvar.md | 2 +- doc/mod/ipcalc.md | 2 +- doc/mod/notification-email.md | 2 +- doc/mod/notification-matrix.md | 2 +- doc/mod/notification-ntfy.md | 2 +- doc/mod/notification-telegram.md | 2 +- doc/mod/scriptrunonce.md | 2 +- doc/mode-button.md | 2 +- doc/ospf-to-leds.md | 2 +- doc/packages-update.md | 2 +- doc/ppp-on-up.md | 2 +- doc/sms-action.md | 2 +- doc/sms-forward.md | 2 +- doc/super-mario-theme.md | 2 +- doc/unattended-lte-firmware-upgrade.md | 2 +- doc/update-gre-address.md | 2 +- doc/update-tunnelbroker.md | 2 +- firmware-upgrade-reboot.rsc | 2 +- global-wait.rsc | 2 +- gps-track.rsc | 2 +- hotspot-to-wpa-cleanup.capsman.rsc | 2 +- hotspot-to-wpa-cleanup.template.rsc | 2 +- hotspot-to-wpa-cleanup.wifi.rsc | 2 +- hotspot-to-wpa.capsman.rsc | 2 +- hotspot-to-wpa.template.rsc | 2 +- hotspot-to-wpa.wifi.rsc | 2 +- ipsec-to-dns.rsc | 2 +- ipv6-update.rsc | 2 +- lease-script.rsc | 2 +- log-forward.rsc | 2 +- mod/bridge-port-to.rsc | 2 +- mod/bridge-port-vlan.rsc | 2 +- mod/inspectvar.rsc | 2 +- mod/ipcalc.rsc | 2 +- mod/notification-email.rsc | 2 +- mod/notification-matrix.rsc | 2 +- mod/notification-ntfy.rsc | 2 +- mod/notification-telegram.rsc | 2 +- mod/scriptrunonce.rsc | 2 +- mode-button.rsc | 2 +- ospf-to-leds.rsc | 2 +- packages-update.rsc | 2 +- ppp-on-up.rsc | 2 +- sms-action.rsc | 2 +- sms-forward.rsc | 2 +- unattended-lte-firmware-upgrade.rsc | 2 +- update-gre-address.rsc | 2 +- update-tunnelbroker.rsc | 2 +- 108 files changed, 108 insertions(+), 108 deletions(-) diff --git a/BRANCHES.md b/BRANCHES.md index 5d94077..8a0bdad 100644 --- a/BRANCHES.md +++ b/BRANCHES.md @@ -4,7 +4,7 @@ Installing from branches [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/CERTIFICATES.md b/CERTIFICATES.md index 589d480..5432d78 100644 --- a/CERTIFICATES.md +++ b/CERTIFICATES.md @@ -4,7 +4,7 @@ Certificate name from browser [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index ef1bd8b..0b35c40 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -4,7 +4,7 @@ Past Contributions [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/INITIAL-COMMANDS.md b/INITIAL-COMMANDS.md index 84a88fe..424ef32 100644 --- a/INITIAL-COMMANDS.md +++ b/INITIAL-COMMANDS.md @@ -4,7 +4,7 @@ Initial commands [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/accesslist-duplicates.capsman.rsc b/accesslist-duplicates.capsman.rsc index 0c4eaaf..27546c8 100644 --- a/accesslist-duplicates.capsman.rsc +++ b/accesslist-duplicates.capsman.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # print duplicate antries in wireless access list # https://rsc.eworm.de/doc/accesslist-duplicates.md diff --git a/accesslist-duplicates.local.rsc b/accesslist-duplicates.local.rsc index 353fe1f..589815d 100644 --- a/accesslist-duplicates.local.rsc +++ b/accesslist-duplicates.local.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # print duplicate antries in wireless access list # https://rsc.eworm.de/doc/accesslist-duplicates.md diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc index 4219014..ccbca3d 100644 --- a/accesslist-duplicates.template.rsc +++ b/accesslist-duplicates.template.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # print duplicate antries in wireless access list # https://rsc.eworm.de/doc/accesslist-duplicates.md diff --git a/accesslist-duplicates.wifi.rsc b/accesslist-duplicates.wifi.rsc index 3ee53d8..527ebb4 100644 --- a/accesslist-duplicates.wifi.rsc +++ b/accesslist-duplicates.wifi.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # print duplicate antries in wireless access list # https://rsc.eworm.de/doc/accesslist-duplicates.md diff --git a/backup-cloud.rsc b/backup-cloud.rsc index efae055..9d76080 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=40 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # upload backup to MikroTik cloud # https://rsc.eworm.de/doc/backup-cloud.md diff --git a/backup-email.rsc b/backup-email.rsc index f6ebad0..d097301 100644 --- a/backup-email.rsc +++ b/backup-email.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=20 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # create and email backup and config file # https://rsc.eworm.de/doc/backup-email.md diff --git a/backup-partition.rsc b/backup-partition.rsc index bfa7765..1f0cf2e 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=70 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, scheduler # # save configuration to fallback partition diff --git a/backup-upload.rsc b/backup-upload.rsc index dc5120f..533cc55 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: backup-script, order=50 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch # # create and upload backup and config file diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index fa76ff5..2726af7 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -4,7 +4,7 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # download and cleanup packages for CAP installation from CAPsMAN # https://rsc.eworm.de/doc/capsman-download-packages.md diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 912e279..0a42bb2 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -4,7 +4,7 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # download and cleanup packages for CAP installation from CAPsMAN # https://rsc.eworm.de/doc/capsman-download-packages.md diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 3a5e7d1..037409a 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -4,7 +4,7 @@ # Michael Gisbers # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # download and cleanup packages for CAP installation from CAPsMAN # https://rsc.eworm.de/doc/capsman-download-packages.md diff --git a/capsman-rolling-upgrade.capsman.rsc b/capsman-rolling-upgrade.capsman.rsc index abe066e..791b3db 100644 --- a/capsman-rolling-upgrade.capsman.rsc +++ b/capsman-rolling-upgrade.capsman.rsc @@ -5,7 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade.capsman -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # upgrade CAPs one after another # https://rsc.eworm.de/doc/capsman-rolling-upgrade.md diff --git a/capsman-rolling-upgrade.template.rsc b/capsman-rolling-upgrade.template.rsc index c1c7ff1..0b1cc2b 100644 --- a/capsman-rolling-upgrade.template.rsc +++ b/capsman-rolling-upgrade.template.rsc @@ -5,7 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade%TEMPL% -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # upgrade CAPs one after another # https://rsc.eworm.de/doc/capsman-rolling-upgrade.md diff --git a/capsman-rolling-upgrade.wifi.rsc b/capsman-rolling-upgrade.wifi.rsc index 44c99db..4afdee2 100644 --- a/capsman-rolling-upgrade.wifi.rsc +++ b/capsman-rolling-upgrade.wifi.rsc @@ -5,7 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: capsman-rolling-upgrade.wifi -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # upgrade CAPs one after another # https://rsc.eworm.de/doc/capsman-rolling-upgrade.md diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc index 5a4043d..91a48de 100644 --- a/certificate-renew-issued.rsc +++ b/certificate-renew-issued.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # renew locally issued certificates # https://rsc.eworm.de/doc/certificate-renew-issued.md diff --git a/check-certificates.rsc b/check-certificates.rsc index 34e7537..25807cb 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch # # check for certificate validity diff --git a/check-health.d/state.rsc b/check-health.d/state.rsc index bcc1fbc..2991935 100644 --- a/check-health.d/state.rsc +++ b/check-health.d/state.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # check for RouterOS health state - state plugin # https://rsc.eworm.de/doc/check-health.md diff --git a/check-health.d/temperature.rsc b/check-health.d/temperature.rsc index 9b84782..a2f632d 100644 --- a/check-health.d/temperature.rsc +++ b/check-health.d/temperature.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # check for RouterOS health state - temperature plugin # https://rsc.eworm.de/doc/check-health.md diff --git a/check-health.d/voltage.rsc b/check-health.d/voltage.rsc index 6394795..9071c88 100644 --- a/check-health.d/voltage.rsc +++ b/check-health.d/voltage.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # check for RouterOS health state - voltage plugin # https://rsc.eworm.de/doc/check-health.md diff --git a/check-health.rsc b/check-health.rsc index 827f597..f02a249 100644 --- a/check-health.rsc +++ b/check-health.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # check for RouterOS health state # https://rsc.eworm.de/doc/check-health.md diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc index 562b8fe..c5b6cb5 100644 --- a/check-lte-firmware-upgrade.rsc +++ b/check-lte-firmware-upgrade.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # check for LTE firmware upgrade, send notification # https://rsc.eworm.de/doc/check-lte-firmware-upgrade.md diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 5c9b392..361be34 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch, scheduler # # check for RouterOS update, send notification and/or install diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc index f718e0b..17e09e3 100644 --- a/collect-wireless-mac.capsman.rsc +++ b/collect-wireless-mac.capsman.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # collect wireless mac adresses in access list # https://rsc.eworm.de/doc/collect-wireless-mac.md diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc index 0017875..4a38bfa 100644 --- a/collect-wireless-mac.local.rsc +++ b/collect-wireless-mac.local.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # collect wireless mac adresses in access list # https://rsc.eworm.de/doc/collect-wireless-mac.md diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc index 527e985..da901be 100644 --- a/collect-wireless-mac.template.rsc +++ b/collect-wireless-mac.template.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # collect wireless mac adresses in access list # https://rsc.eworm.de/doc/collect-wireless-mac.md diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc index 5f9de7d..cb217ce 100644 --- a/collect-wireless-mac.wifi.rsc +++ b/collect-wireless-mac.wifi.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=40 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # collect wireless mac adresses in access list # https://rsc.eworm.de/doc/collect-wireless-mac.md diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index 3803963..36b31c8 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update dhcp-server lease comment with infos from access-list # https://rsc.eworm.de/doc/dhcp-lease-comment.md diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index d5f1461..35dc6f6 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update dhcp-server lease comment with infos from access-list # https://rsc.eworm.de/doc/dhcp-lease-comment.md diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index 2bddc26..47a8554 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update dhcp-server lease comment with infos from access-list # https://rsc.eworm.de/doc/dhcp-lease-comment.md diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc index 515b438..e0f9785 100644 --- a/dhcp-lease-comment.wifi.rsc +++ b/dhcp-lease-comment.wifi.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=60 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update dhcp-server lease comment with infos from access-list # https://rsc.eworm.de/doc/dhcp-lease-comment.md diff --git a/doc/accesslist-duplicates.md b/doc/accesslist-duplicates.md index a6302f5..e4d0c7f 100644 --- a/doc/accesslist-duplicates.md +++ b/doc/accesslist-duplicates.md @@ -4,7 +4,7 @@ Find and remove access list duplicates [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/backup-cloud.md b/doc/backup-cloud.md index d658760..7286960 100644 --- a/doc/backup-cloud.md +++ b/doc/backup-cloud.md @@ -4,7 +4,7 @@ Upload backup to Mikrotik cloud [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/backup-email.md b/doc/backup-email.md index aedae4d..7b8bcfe 100644 --- a/doc/backup-email.md +++ b/doc/backup-email.md @@ -4,7 +4,7 @@ Send backup via e-mail [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/backup-partition.md b/doc/backup-partition.md index 9f62967..9d615a5 100644 --- a/doc/backup-partition.md +++ b/doc/backup-partition.md @@ -4,7 +4,7 @@ Save configuration to fallback partition [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/backup-upload.md b/doc/backup-upload.md index f2858b2..6a5b0e4 100644 --- a/doc/backup-upload.md +++ b/doc/backup-upload.md @@ -4,7 +4,7 @@ Upload backup to server [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/capsman-download-packages.md b/doc/capsman-download-packages.md index d719934..5722227 100644 --- a/doc/capsman-download-packages.md +++ b/doc/capsman-download-packages.md @@ -4,7 +4,7 @@ Download packages for CAP upgrade from CAPsMAN [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/capsman-rolling-upgrade.md b/doc/capsman-rolling-upgrade.md index f366d40..d277db6 100644 --- a/doc/capsman-rolling-upgrade.md +++ b/doc/capsman-rolling-upgrade.md @@ -4,7 +4,7 @@ Run rolling CAP upgrades from CAPsMAN [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/certificate-renew-issued.md b/doc/certificate-renew-issued.md index 096e07b..c4615b5 100644 --- a/doc/certificate-renew-issued.md +++ b/doc/certificate-renew-issued.md @@ -4,7 +4,7 @@ Renew locally issued certificates [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/check-certificates.md b/doc/check-certificates.md index 4188815..4c144ba 100644 --- a/doc/check-certificates.md +++ b/doc/check-certificates.md @@ -4,7 +4,7 @@ Renew certificates and notify on expiration [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/check-health.md b/doc/check-health.md index 51e71bc..7cf0c33 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -4,7 +4,7 @@ Notify about health state [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/check-lte-firmware-upgrade.md b/doc/check-lte-firmware-upgrade.md index 66b2cf5..3693b71 100644 --- a/doc/check-lte-firmware-upgrade.md +++ b/doc/check-lte-firmware-upgrade.md @@ -4,7 +4,7 @@ Notify on LTE firmware upgrade [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/check-routeros-update.md b/doc/check-routeros-update.md index 2e9b8aa..926b4aa 100644 --- a/doc/check-routeros-update.md +++ b/doc/check-routeros-update.md @@ -4,7 +4,7 @@ Notify on RouterOS update [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/collect-wireless-mac.md b/doc/collect-wireless-mac.md index 84c111d..0197522 100644 --- a/doc/collect-wireless-mac.md +++ b/doc/collect-wireless-mac.md @@ -4,7 +4,7 @@ Collect MAC addresses in wireless access list [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/dhcp-lease-comment.md b/doc/dhcp-lease-comment.md index 6a4c930..b02f199 100644 --- a/doc/dhcp-lease-comment.md +++ b/doc/dhcp-lease-comment.md @@ -4,7 +4,7 @@ Comment DHCP leases with info from access list [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/firmware-upgrade-reboot.md b/doc/firmware-upgrade-reboot.md index 7ab6ac5..54f1da0 100644 --- a/doc/firmware-upgrade-reboot.md +++ b/doc/firmware-upgrade-reboot.md @@ -4,7 +4,7 @@ Automatically upgrade firmware and reboot [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/global-wait.md b/doc/global-wait.md index 6787d20..799cae7 100644 --- a/doc/global-wait.md +++ b/doc/global-wait.md @@ -4,7 +4,7 @@ Wait for global functions and modules [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/gps-track.md b/doc/gps-track.md index 9685899..5e4878f 100644 --- a/doc/gps-track.md +++ b/doc/gps-track.md @@ -4,7 +4,7 @@ Send GPS position to server [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/hotspot-to-wpa.md b/doc/hotspot-to-wpa.md index 07d07dc..a2e9748 100644 --- a/doc/hotspot-to-wpa.md +++ b/doc/hotspot-to-wpa.md @@ -4,7 +4,7 @@ Use WPA network with hotspot credentials [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/ip-addr-bridge.md b/doc/ip-addr-bridge.md index ddbcc0a..f9f98e3 100644 --- a/doc/ip-addr-bridge.md +++ b/doc/ip-addr-bridge.md @@ -4,7 +4,7 @@ Manage IP addresses with bridge status [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/ipsec-to-dns.md b/doc/ipsec-to-dns.md index a688e80..123656c 100644 --- a/doc/ipsec-to-dns.md +++ b/doc/ipsec-to-dns.md @@ -4,7 +4,7 @@ Create DNS records for IPSec peers [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/ipv6-update.md b/doc/ipv6-update.md index 42f0fe4..1f009b1 100644 --- a/doc/ipv6-update.md +++ b/doc/ipv6-update.md @@ -4,7 +4,7 @@ Update configuration on IPv6 prefix change [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/lease-script.md b/doc/lease-script.md index 1b59ff7..f83c383 100644 --- a/doc/lease-script.md +++ b/doc/lease-script.md @@ -4,7 +4,7 @@ Run other scripts on DHCP lease [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/leds-mode.md b/doc/leds-mode.md index c01472e..a194396 100644 --- a/doc/leds-mode.md +++ b/doc/leds-mode.md @@ -4,7 +4,7 @@ Manage LEDs dark mode [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/log-forward.md b/doc/log-forward.md index 55b1540..25be00a 100644 --- a/doc/log-forward.md +++ b/doc/log-forward.md @@ -4,7 +4,7 @@ Forward log messages via notification [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/bridge-port-to.md b/doc/mod/bridge-port-to.md index 2ed9dc7..629c526 100644 --- a/doc/mod/bridge-port-to.md +++ b/doc/mod/bridge-port-to.md @@ -4,7 +4,7 @@ Manage ports in bridge [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/bridge-port-vlan.md b/doc/mod/bridge-port-vlan.md index ded2603..cf29199 100644 --- a/doc/mod/bridge-port-vlan.md +++ b/doc/mod/bridge-port-vlan.md @@ -4,7 +4,7 @@ Manage VLANs on bridge ports [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/inspectvar.md b/doc/mod/inspectvar.md index 4e2f4c1..7daba15 100644 --- a/doc/mod/inspectvar.md +++ b/doc/mod/inspectvar.md @@ -4,7 +4,7 @@ Inspect variables [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/ipcalc.md b/doc/mod/ipcalc.md index 9f39429..c07853e 100644 --- a/doc/mod/ipcalc.md +++ b/doc/mod/ipcalc.md @@ -4,7 +4,7 @@ IP address calculation [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/notification-email.md b/doc/mod/notification-email.md index 0bef455..34d1c09 100644 --- a/doc/mod/notification-email.md +++ b/doc/mod/notification-email.md @@ -4,7 +4,7 @@ Send notifications via e-mail [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/notification-matrix.md b/doc/mod/notification-matrix.md index fbc9b91..89c1b01 100644 --- a/doc/mod/notification-matrix.md +++ b/doc/mod/notification-matrix.md @@ -4,7 +4,7 @@ Send notifications via Matrix [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/notification-ntfy.md b/doc/mod/notification-ntfy.md index 04dee35..51756ac 100644 --- a/doc/mod/notification-ntfy.md +++ b/doc/mod/notification-ntfy.md @@ -4,7 +4,7 @@ Send notifications via Ntfy [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md index f55f936..b85d09c 100644 --- a/doc/mod/notification-telegram.md +++ b/doc/mod/notification-telegram.md @@ -4,7 +4,7 @@ Send notifications via Telegram [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mod/scriptrunonce.md b/doc/mod/scriptrunonce.md index 0127c6d..955d12e 100644 --- a/doc/mod/scriptrunonce.md +++ b/doc/mod/scriptrunonce.md @@ -4,7 +4,7 @@ Download script and run it once [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/mode-button.md b/doc/mode-button.md index 7feb19f..be15bc9 100644 --- a/doc/mode-button.md +++ b/doc/mode-button.md @@ -4,7 +4,7 @@ Mode button with multiple presses [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/ospf-to-leds.md b/doc/ospf-to-leds.md index 23248b5..3694d35 100644 --- a/doc/ospf-to-leds.md +++ b/doc/ospf-to-leds.md @@ -4,7 +4,7 @@ Visualize OSPF state via LEDs [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/packages-update.md b/doc/packages-update.md index 8b0d4a3..75225fe 100644 --- a/doc/packages-update.md +++ b/doc/packages-update.md @@ -4,7 +4,7 @@ Manage system update [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/ppp-on-up.md b/doc/ppp-on-up.md index 7902f3b..305afc1 100644 --- a/doc/ppp-on-up.md +++ b/doc/ppp-on-up.md @@ -4,7 +4,7 @@ Run scripts on ppp connection [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/sms-action.md b/doc/sms-action.md index 5de7f0d..b696c85 100644 --- a/doc/sms-action.md +++ b/doc/sms-action.md @@ -4,7 +4,7 @@ Act on received SMS [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/sms-forward.md b/doc/sms-forward.md index 8e7417b..ccb6482 100644 --- a/doc/sms-forward.md +++ b/doc/sms-forward.md @@ -4,7 +4,7 @@ Forward received SMS [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/super-mario-theme.md b/doc/super-mario-theme.md index 2ffb25b..c72f220 100644 --- a/doc/super-mario-theme.md +++ b/doc/super-mario-theme.md @@ -4,7 +4,7 @@ Play Super Mario theme [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/unattended-lte-firmware-upgrade.md b/doc/unattended-lte-firmware-upgrade.md index e9a888c..cb96aa1 100644 --- a/doc/unattended-lte-firmware-upgrade.md +++ b/doc/unattended-lte-firmware-upgrade.md @@ -4,7 +4,7 @@ Install LTE firmware upgrade [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/update-gre-address.md b/doc/update-gre-address.md index 7e101c4..de9f622 100644 --- a/doc/update-gre-address.md +++ b/doc/update-gre-address.md @@ -4,7 +4,7 @@ Update GRE configuration with dynamic addresses [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/doc/update-tunnelbroker.md b/doc/update-tunnelbroker.md index 126d470..ee0fe98 100644 --- a/doc/update-tunnelbroker.md +++ b/doc/update-tunnelbroker.md @@ -4,7 +4,7 @@ Update tunnelbroker configuration [![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) [![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) [![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) -[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.14-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) [![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) [![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc index e3d62de..86a9a8c 100644 --- a/firmware-upgrade-reboot.rsc +++ b/firmware-upgrade-reboot.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2022-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # install firmware upgrade, and reboot # https://rsc.eworm.de/doc/firmware-upgrade-reboot.md diff --git a/global-wait.rsc b/global-wait.rsc index bc98462..ca3fc0c 100644 --- a/global-wait.rsc +++ b/global-wait.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # wait for global-functions to finish # https://rsc.eworm.de/doc/global-wait.md diff --git a/gps-track.rsc b/gps-track.rsc index 5e35f8d..dea56d2 100644 --- a/gps-track.rsc +++ b/gps-track.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch # # track gps data by sending json data to http server diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index c21ec3e..033d0e7 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index 1bd877e..0f8c490 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index 8e36204..dfec697 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -4,7 +4,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: lease-script, order=80 -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # manage and clean up private WPA passphrase after hotspot login diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc index de9f9d9..3f51475 100644 --- a/hotspot-to-wpa.capsman.rsc +++ b/hotspot-to-wpa.capsman.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # add private WPA passphrase after hotspot login diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc index 003b12e..068241d 100644 --- a/hotspot-to-wpa.template.rsc +++ b/hotspot-to-wpa.template.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # add private WPA passphrase after hotspot login diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc index 0d6a7b9..cc5e2fc 100644 --- a/hotspot-to-wpa.wifi.rsc +++ b/hotspot-to-wpa.wifi.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, hotspot # # add private WPA passphrase after hotspot login diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc index 91f6b45..26dab0a 100644 --- a/ipsec-to-dns.rsc +++ b/ipsec-to-dns.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2021-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, ipsec # # and add/remove/update DNS entries from IPSec mode-config diff --git a/ipv6-update.rsc b/ipv6-update.rsc index 7eb625b..c6e3d65 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update firewall and dns settings on IPv6 prefix change # https://rsc.eworm.de/doc/ipv6-update.md diff --git a/lease-script.rsc b/lease-script.rsc index b6ceac9..bf27fda 100644 --- a/lease-script.rsc +++ b/lease-script.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # run scripts on DHCP lease # https://rsc.eworm.de/doc/lease-script.md diff --git a/log-forward.rsc b/log-forward.rsc index 379fa54..58ec956 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # forward log messages via notification # https://rsc.eworm.de/doc/log-forward.md diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc index f00e10b..39a036e 100644 --- a/mod/bridge-port-to.rsc +++ b/mod/bridge-port-to.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # reset bridge ports to default bridge # https://rsc.eworm.de/doc/mod/bridge-port-to.md diff --git a/mod/bridge-port-vlan.rsc b/mod/bridge-port-vlan.rsc index 62e71e3..0eeb9b5 100644 --- a/mod/bridge-port-vlan.rsc +++ b/mod/bridge-port-vlan.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # manage VLANs on bridge ports # https://rsc.eworm.de/doc/mod/bridge-port-vlan.md diff --git a/mod/inspectvar.rsc b/mod/inspectvar.rsc index 0f05da7..c861557 100644 --- a/mod/inspectvar.rsc +++ b/mod/inspectvar.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # inspect variables # https://rsc.eworm.de/doc/mod/inspectvar.md diff --git a/mod/ipcalc.rsc b/mod/ipcalc.rsc index fbed74b..477cf4a 100644 --- a/mod/ipcalc.rsc +++ b/mod/ipcalc.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # ip address calculation # https://rsc.eworm.de/doc/mod/ipcalc.md diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 404e74d..7b89d98 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, email, scheduler # # send notifications via e-mail diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc index 9b2b641..e989ee0 100644 --- a/mod/notification-matrix.rsc +++ b/mod/notification-matrix.rsc @@ -4,7 +4,7 @@ # Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch, scheduler # # send notifications via Matrix diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 212fde2..aac6d6c 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch, scheduler # # send notifications via Ntfy (ntfy.sh) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index c3ef2dd..23ef942 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch, scheduler # # send notifications via Telegram diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index e5368c4..b158c9c 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch # # download script and run it once diff --git a/mode-button.rsc b/mode-button.rsc index 4cf5e75..edc5f40 100644 --- a/mode-button.rsc +++ b/mode-button.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, scheduler # # act on multiple mode and reset button presses diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc index 9d822c1..a8662b3 100644 --- a/ospf-to-leds.rsc +++ b/ospf-to-leds.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # visualize ospf instance state via leds # https://rsc.eworm.de/doc/ospf-to-leds.md diff --git a/packages-update.rsc b/packages-update.rsc index afec2f5..b11596e 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2019-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, scheduler # # download packages and reboot for installation diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc index 85e9689..e09bd9d 100644 --- a/ppp-on-up.rsc +++ b/ppp-on-up.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # run scripts on ppp up # https://rsc.eworm.de/doc/ppp-on-up.md diff --git a/sms-action.rsc b/sms-action.rsc index 34d2127..3c8307a 100644 --- a/sms-action.rsc +++ b/sms-action.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # run action on received SMS # https://rsc.eworm.de/doc/sms-action.md diff --git a/sms-forward.rsc b/sms-forward.rsc index 654fd56..8169022 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -4,7 +4,7 @@ # Anatoly Bubenkov # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # forward SMS to e-mail # https://rsc.eworm.de/doc/sms-forward.md diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc index 74495d1..83925fd 100644 --- a/unattended-lte-firmware-upgrade.rsc +++ b/unattended-lte-firmware-upgrade.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2018-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, scheduler # # schedule unattended lte firmware upgrade diff --git a/update-gre-address.rsc b/update-gre-address.rsc index 6b169a0..cddfa92 100644 --- a/update-gre-address.rsc +++ b/update-gre-address.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2013-2025 Christian Hesse # https://rsc.eworm.de/COPYING.md # -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # # update gre interface remote address with dynamic address from # ipsec remote peer diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index a58589b..45afa6f 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -5,7 +5,7 @@ # https://rsc.eworm.de/COPYING.md # # provides: ppp-on-up -# requires RouterOS, version=7.14 +# requires RouterOS, version=7.15 # requires device-mode, fetch # # update local address of tunnelbroker interface From a8e5b5226bc6a11a0ccbca0f3becc85f9f4904e3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 11:04:09 +0100 Subject: [PATCH 200/273] global-functions: $RmFile: fail on wrong type --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 2799f39..ac37dee 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1037,6 +1037,11 @@ $LogPrint debug $0 ("Removing file: ". $FileName); + :if ([ :len [ /file/find where name=$FileName type!=file ] ] > 0) do={ + $LogPrint error $0 ("File '" . $FileName . "' is not a file."); + :return false; + } + :local File [ /file/find where name=$FileName type=file ]; :if ([ :len $File ] = 0) do={ $LogPrint debug $0 ("... which does not exist."); From 82020ddd73163194eb75aaa6f57d8e41597a7e6f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 11:03:34 +0100 Subject: [PATCH 201/273] global-functions: $RmDir: fail on wrong type --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index ac37dee..cf278eb 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1014,6 +1014,11 @@ $LogPrint debug $0 ("Removing directory: ". $DirName); + :if ([ :len [ /file/find where name=$DirName type!=directory ] ] > 0) do={ + $LogPrint error $0 ("Directory '" . $DirName . "' is not a directory."); + :return false; + } + :local Dir [ /file/find where name=$DirName type=directory ]; :if ([ :len $Dir ] = 0) do={ $LogPrint debug $0 ("... which does not exist."); From dbdf2952443ada35695925628999db4ddbe80be0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:33:35 +0100 Subject: [PATCH 202/273] global-functions: $CertificateDownload: use $RmFile --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index cf278eb..782c1a3 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -149,6 +149,7 @@ :global CleanName; :global FetchUserAgentStr; :global LogPrint; + :global RmFile; :global WaitForFile; $LogPrint info $0 ("Downloading and importing certificate with " . \ @@ -172,7 +173,7 @@ dst-path=$FileName as-value; $WaitForFile $FileName; :if ([ /file/get $FileName size ] = 0) do={ - /file/remove $FileName; + $RmFile $FileName; :error false; } } on-error={ @@ -183,7 +184,7 @@ /certificate/import file-name=$FileName passphrase="" as-value; :delay 1s; - /file/remove [ find where name=$FileName ]; + $RmFile $FileName; :if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={ /certificate/remove [ find where name~("^" . $FileName . "_[0-9]+\$") ]; From ea8ec6b580071d832df28fd78a9e3c4c07a17bef Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:35:39 +0100 Subject: [PATCH 203/273] global-functions: $DownloadPackage: use $RmFile --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 782c1a3..b19ec56 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -343,6 +343,7 @@ :global CleanFilePath; :global LogPrint; :global MkDir; + :global RmFile; :global WaitForFile; :if ([ :len $PkgName ] = 0) do={ :return false; } @@ -386,7 +387,7 @@ $LogPrint debug $0 ("Downloading package file failed."); } - /file/remove [ find where name=$PkgDest ]; + $RmFile $PkgDest; :set Retry ($Retry - 1); } From d19b90df08dd179163c501a08d53eaf15bc53f15 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:37:01 +0100 Subject: [PATCH 204/273] global-functions: $FetchHuge: use $RmFile --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index b19ec56..ab6610e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -457,6 +457,7 @@ :global IfThenElse; :global LogPrint; :global MkDir; + :global RmFile; :global WaitForFile; :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ]; @@ -473,7 +474,7 @@ http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value; } on-error={ :if ([ $WaitForFile $FileName 500ms ] = true) do={ - /file/remove $FileName; + $RmFile $FileName; } $LogPrint debug $0 ("Failed downloading from: " . $Url); /file/remove $DirName; From 4760515add1f753af7596245eb1a6c560ea37031 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:38:09 +0100 Subject: [PATCH 205/273] global-functions: $FetchHuge: use $RmDir --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index ab6610e..e680b60 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -457,6 +457,7 @@ :global IfThenElse; :global LogPrint; :global MkDir; + :global RmDir; :global RmFile; :global WaitForFile; @@ -477,7 +478,7 @@ $RmFile $FileName; } $LogPrint debug $0 ("Failed downloading from: " . $Url); - /file/remove $DirName; + $RmDir $DirName; :return false; } $WaitForFile $FileName; @@ -493,7 +494,7 @@ :delay 100ms; } } - /file/remove $DirName; + $RmDir $DirName; :return $Return; } From f5f00b70e325d80db939dcc2aa885b80845566fa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Jan 2025 18:41:58 +0100 Subject: [PATCH 206/273] global-functions: $MkDir: use $RmDir --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index e680b60..4b1f63d 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -857,6 +857,7 @@ :global CleanFilePath; :global LogPrint; + :global RmDir; :global WaitForFile; :local MkTmpfs do={ @@ -873,7 +874,7 @@ } $LogPrint info $0 ("Creating disk of type tmpfs."); - /file/remove [ find where name="tmpfs" type="directory" ]; + $RmDir "tmpfs"; :do { /disk/add slot=tmpfs type=tmpfs tmpfs-max-size=([ /system/resource/get total-memory ] / 3); $WaitForFile "tmpfs"; From d748b69142a8b2b2d4328ef0e07dabe01fdbc01e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:13:43 +0100 Subject: [PATCH 207/273] backup-cloud: use $RmDir --- backup-cloud.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index 9d76080..c4e23b2 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -26,6 +26,7 @@ :global LogPrint; :global MkDir; :global RandomDelay; + :global RmDir; :global ScriptFromTerminal; :global ScriptLock; :global SendNotification2; @@ -97,7 +98,7 @@ $LogPrint error $ScriptName ("Failed uploading backup for " . $Identity . " to cloud!"); :set PackagesUpdateBackupFailure true; } - /file/remove "tmpfs/backup-cloud"; + $RmDir "tmpfs/backup-cloud"; } on-error={ :global ExitError; $ExitError $ExitOK [ :jobname ]; } From 81ba47a07d97a4cc36fc020cf35de7656e2abbb2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:10:46 +0100 Subject: [PATCH 208/273] backup-upload: use $RmDir --- backup-upload.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-upload.rsc b/backup-upload.rsc index 533cc55..7f15a86 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -35,6 +35,7 @@ :global LogPrint; :global MkDir; :global RandomDelay; + :global RmDir; :global ScriptFromTerminal; :global ScriptLock; :global SendNotification2; @@ -170,7 +171,7 @@ :if ($Failed = 1) do={ :set PackagesUpdateBackupFailure true; } - /file/remove $DirName; + $RmDir $DirName; } on-error={ :global ExitError; $ExitError $ExitOK [ :jobname ]; } From 88ff03136805f40f14bb5d39af370c0ace62c4e7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:10:05 +0100 Subject: [PATCH 209/273] backup-upload: use $RmFile --- backup-upload.rsc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backup-upload.rsc b/backup-upload.rsc index 7f15a86..14c3914 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -36,6 +36,7 @@ :global MkDir; :global RandomDelay; :global RmDir; + :global RmFile; :global ScriptFromTerminal; :global ScriptLock; :global SendNotification2; @@ -100,7 +101,7 @@ :set Failed 1; } - /file/remove ($FilePath . ".backup"); + $RmFile ($FilePath . ".backup"); } # create configuration export @@ -119,7 +120,7 @@ :set Failed 1; } - /file/remove ($FilePath . ".rsc"); + $RmFile ($FilePath . ".rsc"); } # global-config-overlay @@ -140,7 +141,7 @@ :set Failed 1; } - /file/remove ($FilePath . ".conf"); + $RmFile ($FilePath . ".conf"); } :local FileInfo do={ From 63db96bdccc9c9c1356e71683157383322b40285 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:06:33 +0100 Subject: [PATCH 210/273] capsman-download-packages: use $RmFile --- capsman-download-packages.capsman.rsc | 3 ++- capsman-download-packages.template.rsc | 3 ++- capsman-download-packages.wifi.rsc | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index 2726af7..4387cb1 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -22,6 +22,7 @@ :global DownloadPackage; :global LogPrint; :global MkDir; + :global RmFile; :global ScriptLock; :global WaitFullyConnected; @@ -61,7 +62,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - /file/remove $Package; + $RmFile $Package; } } diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 0a42bb2..744494e 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -23,6 +23,7 @@ :global DownloadPackage; :global LogPrint; :global MkDir; + :global RmFile; :global ScriptLock; :global WaitFullyConnected; @@ -63,7 +64,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - /file/remove $Package; + $RmFile $Package; } } diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 037409a..a0c5e12 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -22,6 +22,7 @@ :global DownloadPackage; :global LogPrint; :global MkDir; + :global RmFile; :global ScriptLock; :global WaitFullyConnected; @@ -61,7 +62,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - /file/remove $Package; + $RmFile $Package; } } From 6570a84904bcdd6d74090944f0fc94d1b94add90 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:08:40 +0100 Subject: [PATCH 211/273] check-certificates: use $RmFile --- check-certificates.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 25807cb..0907395 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -44,6 +44,7 @@ :global EscapeForRegEx; :global FetchUserAgentStr; :global LogPrint; + :global RmFile; :global UrlEncode; :global WaitForFile; @@ -63,7 +64,7 @@ :set DecryptionFailed false; } } - /file/remove [ find where name=$CertFileName ]; + $RmFile $CertFileName; :if ($DecryptionFailed = true) do={ $LogPrint warning $ScriptName ("Decryption failed for certificate file '" . $CertFileName . "'."); From 0fea300feaaaf8f3c87facb99e04126753713c76 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:12:51 +0100 Subject: [PATCH 212/273] mod/ssh-keys-import: use $RmDir --- mod/ssh-keys-import.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index 35aa7ec..2fae4b1 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -19,6 +19,7 @@ :global GetRandom20CharAlNum; :global LogPrint; :global MkDir; + :global RmDir; :global WaitForFile; :if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={ @@ -58,10 +59,10 @@ /user/ssh-keys/import public-key-file=$FileName user=$User; $LogPrint info $0 ("Imported ssh public key (" . $KeyVal->2 . ", " . $KeyVal->0 . ", " . \ "MD5:" . $FingerPrintMD5 . ") for user '" . $User . "'."); - /file/remove "tmpfs/ssh-keys-import"; + $RmDir "tmpfs/ssh-keys-import"; } on-error={ $LogPrint warning $0 ("Failed importing key."); - /file/remove "tmpfs/ssh-keys-import"; + $RmDir "tmpfs/ssh-keys-import"; :return false; } } on-error={ From b156fc43cfde99935eb78d95c6a5eae35b8f70f1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Feb 2025 16:14:58 +0100 Subject: [PATCH 213/273] telegram-chat: use $RmDir --- telegram-chat.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 8f29d8c..10952a6 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -37,6 +37,7 @@ :global MIN; :global MkDir; :global RandomDelay; + :global RmDir; :global ScriptLock; :global SendTelegram2; :global SymbolForNotification; @@ -154,7 +155,7 @@ $State . [ $IfThenElse ([ :len $Content ] > 0) \ ([ $SymbolForNotification "memo" ] . "Output:\n" . $Content) \ ([ $SymbolForNotification "memo" ] . "No output.") ]) }); - /file/remove "tmpfs/telegram-chat"; + $RmDir "tmpfs/telegram-chat"; } else={ $LogPrint info $ScriptName ("The command from update " . $UpdateID . " failed syntax validation!"); $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; replyto=($Message->"message_id"); \ From fc3beac83b8a6fd35a7b3736759f15bb8b71a723 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 08:42:17 +0100 Subject: [PATCH 214/273] log-forward: make empty string a special meaning --- global-config.rsc | 10 +++++----- log-forward.rsc | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/global-config.rsc b/global-config.rsc index df26ef9..5df7b34 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -119,17 +119,17 @@ :global FwAddrListTimeOut 1d; # This defines what log messages to filter or include by topic or message -# text. Regular expressions are supported. Do *NOT* set an empty string, -# that will filter or include everything! +# text. Regular expressions are supported. An empty string has a special +# meaning not to filter or include anything. # These are filters, so excluding messages from forwarding. :global LogForwardFilter "(debug|info|packet|raw)"; -:global LogForwardFilterMessage []; +:global LogForwardFilterMessage ""; #:global LogForwardFilterMessage "message text"; #:global LogForwardFilterMessage "(message text|another text|...)"; # ... and another setting with reverse logic. This includes messages even # if filtered above. -:global LogForwardInclude []; -:global LogForwardIncludeMessage []; +:global LogForwardInclude ""; +:global LogForwardIncludeMessage ""; #:global LogForwardInclude "account"; #:global LogForwardIncludeMessage "message text"; diff --git a/log-forward.rsc b/log-forward.rsc index 58ec956..afeb3f2 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -57,6 +57,11 @@ :local MessageVal; :local MessageDups ({}); + :set LogForwardFilter [ $EitherOr $LogForwardFilter [] ]; + :set LogForwardFilterMessage [ $EitherOr $LogForwardFilterMessage [] ]; + :set LogForwardInclude [ $EitherOr $LogForwardInclude [] ]; + :set LogForwardIncludeMessage [ $EitherOr $LogForwardIncludeMessage [] ]; + :local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ]; :foreach Message in=[ /log/find where (!(message="") and \ !(message~$LogForwardFilterLogForwardingCached) and \ From 2e42f7963c2186512c4fa2cd75de7ab07754f229 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 08:45:25 +0100 Subject: [PATCH 215/273] mod/notification-ntfy: use empty strings as default... ... which should be fine now that the credentials are not passed with fetch's properties, but as properly formatted authentication header. --- global-config.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global-config.rsc b/global-config.rsc index 5df7b34..b0f0c64 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -56,9 +56,9 @@ # install the module: # $ScriptInstallUpdate mod/notification-ntfy :global NtfyServer "ntfy.sh"; -:global NtfyServerUser []; -:global NtfyServerPass []; -:global NtfyServerToken []; +:global NtfyServerUser ""; +:global NtfyServerPass ""; +:global NtfyServerToken ""; :global NtfyTopic ""; # It is possible to override e-mail, Telegram, Matrix and Ntfy setting From da280586b5012feb576cd7cd3e911d00ac7bf63e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 14:00:37 +0100 Subject: [PATCH 216/273] doc/log-forward: add a hint on defaults --- doc/log-forward.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/log-forward.md b/doc/log-forward.md index 25be00a..93f6a7d 100644 --- a/doc/log-forward.md +++ b/doc/log-forward.md @@ -53,6 +53,12 @@ Just install the script: Configuration ------------- +The default configuration should provide reasonable presets, filtering +*info*, and effectively forwarding *warning* and *error*. + +> đŸ’Ąī¸ **Hint**: Please try with defaults first, especially if you are not +> familiar with regular expressions! + The configuration goes to `global-config-overlay`, these are the parameters: * `LogForwardFilter`: define topics *not* to be forwarded From 8af67af462369968238afe874a24c26141b0b5c9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Feb 2025 14:08:06 +0100 Subject: [PATCH 217/273] doc/log-forward: mention ntfy --- doc/log-forward.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/log-forward.md b/doc/log-forward.md index 93f6a7d..3c19569 100644 --- a/doc/log-forward.md +++ b/doc/log-forward.md @@ -22,15 +22,15 @@ server (see `/system/logging`). This has some limitation, however: * does not work early after boot if network connectivity is not yet established, or breaks intermittently * lots of messages generate a flood of mails -* Matrix and Telegram are not supported +* Matrix, Ntfy and Telegram are not supported The script works around the limitations, for example it does: * read from `/log`, including messages from early boot * skip multi-repeated messages * rate-limit itself to mitigate flooding -* forward via notification (which includes *e-mail*, *Matrix* and *Telegram* - when installed and configured, see below) +* forward via notification (which includes *e-mail*, *Matrix*, *Ntfy* and + *Telegram* when installed and configured, see below) It is intended to be run periodically from scheduler, then collects new log messages and forwards them via notification. From 4d0b4a1ff4137ae0b5508fb16428ac4da7205410 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 11 Feb 2025 14:30:14 +0100 Subject: [PATCH 218/273] fw-addr-lists: these lists are deprecated and discontinued Any alternatives around? --- certs/GlobalSign.pem | 28 ---------------------------- certs/Makefile | 2 -- doc/fw-addr-lists.md | 6 +++--- global-config.rsc | 4 ---- 4 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 certs/GlobalSign.pem diff --git a/certs/GlobalSign.pem b/certs/GlobalSign.pem deleted file mode 100644 index 47035e4..0000000 --- a/certs/GlobalSign.pem +++ /dev/null @@ -1,28 +0,0 @@ -# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 -# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 -# Label: "GlobalSign Root CA - R3" -# Serial: 4835703278459759426209954 -# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28 -# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad -# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE----- diff --git a/certs/Makefile b/certs/Makefile index ba25303..4e252b4 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -23,12 +23,10 @@ DOMAINS_IPV4 = \ 8.8.8.8/GTS-Root-R1 \ 9.9.9.9/DigiCert-Global-Root-G3 \ api.mullvad.net/ISRG-Root-X1 \ - feodotracker.abuse.ch/GlobalSign \ ipv4.showipv6.de/ISRG-Root-X1 \ ipv4.tunnelbroker.net/Starfield-Root-Certificate-Authority-G2 \ mkcert.org/ISRG-Root-X1 \ ntfy.sh/ISRG-Root-X1 \ - sslbl.abuse.ch/GlobalSign \ www.dshield.org/ISRG-Root-X1 \ www.spamhaus.org/GTS-Root-R4 DOMAINS_IPV6 = \ diff --git a/doc/fw-addr-lists.md b/doc/fw-addr-lists.md index f581fd2..b888d4b 100644 --- a/doc/fw-addr-lists.md +++ b/doc/fw-addr-lists.md @@ -19,9 +19,9 @@ Description This script downloads, imports and updates firewall address-lists. Its main purpose is to block attacking ip addresses, spam hosts, command-and-control servers and similar malicious entities. The default configuration contains -lists from [abuse.ch](https://abuse.ch/), [dshield.org](https://dshield.org/) -and [blocklist.de](https://www.blocklist.de/), and -lists from [spamhaus.org](https://spamhaus.org/) are prepared. +lists from [dshield.org](https://dshield.org/) and +[blocklist.de](https://www.blocklist.de/), and lists from +[spamhaus.org](https://spamhaus.org/) are prepared. The address-lists are updated in place, so after initial import you will not see situation when the lists are not populated. diff --git a/global-config.rsc b/global-config.rsc index b0f0c64..2be4752 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -98,10 +98,6 @@ "block"={ # { url="https://rsc.eworm.de/main/fw-addr-lists.d/block"; # cert="ISRG Root X2" }; - { url="https://feodotracker.abuse.ch/downloads/ipblocklist_recommended.txt"; - cert="GlobalSign" }; - { url="https://sslbl.abuse.ch/blacklist/sslipblacklist.txt"; - cert="GlobalSign" }; { url="https://www.dshield.org/block.txt"; cidr="/24"; cert="ISRG Root X1" }; { url="https://lists.blocklist.de/lists/strongips.txt"; From e1c561dd91dff9ad7c6bdd1e3496e126a8ac8b2c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 11 Feb 2025 14:56:43 +0100 Subject: [PATCH 219/273] global-functions: $MkDir: add debug output --- global-functions.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 4b1f63d..645ce3c 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -891,7 +891,10 @@ :return true; } + $LogPrint debug $0 ("Making directory: " . $Path); + :if ([ :len [ /file/find where name=$Path type="directory" ] ] = 1) do={ + $LogPrint debug $0 ("... which already exists."); :return true; } From d41f7585504b592938da5ea0fc68870d1f68c0f5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 11 Feb 2025 15:32:05 +0100 Subject: [PATCH 220/273] introduce DEBUG info --- DEBUG.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 DEBUG.md diff --git a/DEBUG.md b/DEBUG.md new file mode 100644 index 0000000..3d7f025 --- /dev/null +++ b/DEBUG.md @@ -0,0 +1,49 @@ +Debug output and logs +===================== + +[![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network) +[![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers) +[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/) +[![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts) +[![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) + +[âŦ…ī¸ Go back to main README](README.md) + +Sometimes scripts do not behave as expected. In these cases debug output +or logs can help. + +## Debug output + +Run this command in a terminal: + + :set PrintDebug true; + +You will then see debug output when running the script from terminal. + +To revert to default output run: + + :set PrintDebug false; + +### Debug output for specific script + +Even having debug output for a specific script or function only (or a +set of) is possible. To enable debug output for `telegram-chat` run: + + :set ($PrintDebugOverride->"telegram-chat") true; + +## Debug logs + +The debug info can go to system log. To make it show up in `memory` run: + + /system/logging/add topics=script,debug action=memory; + +Other actions (`disk`, `email`, `remote` or `support`) can be used as +well. I do not recommend using `echo` - use [debug output](#debug-output) +instead. + +Disable or remote that setting to restore regular logging. + +--- +[âŦ…ī¸ Go back to main README](README.md) +[âŦ†ī¸ Go back to top](#top) From c8759381e90408a01dd842e837724b77f2d8c237 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 11 Feb 2025 19:14:42 +0100 Subject: [PATCH 221/273] global-functions: $WaitForFile: check that we can get properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like RouterOS 7.18beta2 brings more breakage. Having a file available in listing is just the first step now. We also need to make sure that the file properties are accessible... đŸ¤Ē I have seen this taking several tens of seconds at least... đŸ¤ĒđŸ¤Ē So let's just try until we have properties available, or the file vanishes. Reported as SUP-179200. 🤞 --- global-functions.rsc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 645ce3c..13dca64 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1669,6 +1669,7 @@ :global CleanFilePath; :global EitherOr; + :global LogPrintOnce; :global MAX; :set FileName [ $CleanFilePath $FileName ]; @@ -1682,7 +1683,20 @@ :delay $Delay; :set I ($I + 1); } - :return true; + + :while ([ :len [ /file/find where name=$FileName ] ] > 0) do={ + :do { + /file/get $FileName; + :return true; + } on-error={ + $LogPrintOnce warning $0 \ + ("Hit the infamous file handling breakage (SUP-179200) introduced with RouterOS 7.18beta2..."); + } + :delay $Delay; + :set Delay ($Delay * 3 / 2); + } + + :return false; } # wait to be fully connected (default route is reachable, time is sync, DNS resolves) From df631b987d86b3b20cd55de9a005b13703576784 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Feb 2025 12:13:17 +0100 Subject: [PATCH 222/273] fw-addr-lists: add a collective list in default configuration --- doc/fw-addr-lists.md | 3 ++- global-config.rsc | 4 ++++ global-functions.rsc | 2 +- news-and-changes.rsc | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/fw-addr-lists.md b/doc/fw-addr-lists.md index b888d4b..cb560d7 100644 --- a/doc/fw-addr-lists.md +++ b/doc/fw-addr-lists.md @@ -18,7 +18,8 @@ Description This script downloads, imports and updates firewall address-lists. Its main purpose is to block attacking ip addresses, spam hosts, command-and-control -servers and similar malicious entities. The default configuration contains +servers and similar malicious entities. The default configuration contains a +[collective list by GitHub user @stamparm](https://github.com/stamparm/ipsum), lists from [dshield.org](https://dshield.org/) and [blocklist.de](https://www.blocklist.de/), and lists from [spamhaus.org](https://spamhaus.org/) are prepared. diff --git a/global-config.rsc b/global-config.rsc index 2be4752..b364a25 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -90,6 +90,7 @@ :global BackupPartitionCopyBeforeFeatureUpdate false; # This defines the settings for firewall address-lists (fw-addr-lists). +# Warning: Mind your device's resources - memory and processing! :global FwAddrLists { # "allow"={ # { url="https://rsc.eworm.de/main/fw-addr-lists.d/allow"; @@ -98,6 +99,9 @@ "block"={ # { url="https://rsc.eworm.de/main/fw-addr-lists.d/block"; # cert="ISRG Root X2" }; + { url="https://raw.githubusercontent.com/stamparm/ipsum/refs/heads/master/levels/4.txt"; +# # higher level (decrease the numerical value) for more addresses, and vice versa + cert="DigiCert Global Root G2" }; { url="https://www.dshield.org/block.txt"; cidr="/24"; cert="ISRG Root X1" }; { url="https://lists.blocklist.de/lists/strongips.txt"; diff --git a/global-functions.rsc b/global-functions.rsc index 13dca64..5996370 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -13,7 +13,7 @@ :local ScriptName [ :jobname ]; # expected configuration version -:global ExpectedConfigVersion 132; +:global ExpectedConfigVersion 133; # global variables not to be changed by user :global GlobalFunctionsReady false; diff --git a/news-and-changes.rsc b/news-and-changes.rsc index c7e566f..6f9e96e 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -57,6 +57,7 @@ 130="Dropped intermediate certificates, depending on just root certificates now."; 131="Enhanced certificate download to fallback to mkcert.org, so all (commonly trusted) root certificates are available now."; 132="Split off plugins from 'check-health', so the script works on all devices to monitor CPU and RAM. The supported plugins for sensors in hardware are installed automatically."; + 133="Updated the default configuration for 'fw-addr-lists', deprecated lists were removed, a collective list was added."; }; # Migration steps to be applied on script updates From b7b3b43f3b11a280dbb465a425a5a554c2e8e471 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Feb 2025 13:59:31 +0100 Subject: [PATCH 223/273] mod/scriptrunonce: use $FetchHuge --- mod/scriptrunonce.rsc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index b158c9c..683e416 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -4,7 +4,6 @@ # https://rsc.eworm.de/COPYING.md # # requires RouterOS, version=7.15 -# requires device-mode, fetch # # download script and run it once # https://rsc.eworm.de/doc/mod/scriptrunonce.md @@ -18,6 +17,7 @@ :global ScriptRunOnceBaseUrl; :global ScriptRunOnceUrlSuffix; + :global FetchHuge; :global LogPrint; :global ValidateSyntax; @@ -30,11 +30,10 @@ :set Script ($ScriptRunOnceBaseUrl . $Script . ".rsc" . $ScriptRunOnceUrlSuffix); } - :local Source; - :do { - :set Source ([ /tool/fetch check-certificate=yes-without-crl $Script output=user as-value ]->"data"); - } on-error={ + :local Source [ $FetchHuge $0 $Script true ]; + :if ($Source = false) do={ $LogPrint warning $0 ("Failed fetching script '" . $Script . "'!"); + :return false; } :if ([ :len $Source ] > 0) do={ From 1c957dbc6d0a35d48f18f2fde0f2061f334feca8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Feb 2025 14:01:10 +0100 Subject: [PATCH 224/273] mod/scriptrunonce: resolve nested conditions --- mod/scriptrunonce.rsc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index 683e416..9d990a1 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -36,17 +36,16 @@ :return false; } - :if ([ :len $Source ] > 0) do={ - :if ([ $ValidateSyntax $Source ] = true) do={ - :do { - $LogPrint info $0 ("Running script '" . $Script . "' now."); - [ :parse $Source ]; - } on-error={ - $LogPrint warning $0 ("The script '" . $Script . "' failed to run!"); - } - } else={ - $LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!"); - } + :if ([ $ValidateSyntax $Source ] = false) do={ + $LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!"); + :return false; + } + + :do { + $LogPrint info $0 ("Running script '" . $Script . "' now."); + [ :parse $Source ]; + } on-error={ + $LogPrint warning $0 ("The script '" . $Script . "' failed to run!"); } } } on-error={ From 5715bc7b57ced8f38b394d535028659655a71801 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Feb 2025 14:02:33 +0100 Subject: [PATCH 225/273] mod/scriptrunonce: always give proper return code --- mod/scriptrunonce.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc index 9d990a1..7fcd5b5 100644 --- a/mod/scriptrunonce.rsc +++ b/mod/scriptrunonce.rsc @@ -46,7 +46,10 @@ [ :parse $Source ]; } on-error={ $LogPrint warning $0 ("The script '" . $Script . "' failed to run!"); + :return false; } + + :return true; } } on-error={ :global ExitError; $ExitError false $0; From 584e507fd18f0a0d97f6e3cbfc4f3f6e0d4854fc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Feb 2025 08:50:49 +0100 Subject: [PATCH 226/273] global-functions: $DeviceInfo: show commit id (if available) --- global-functions.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 5996370..71e5c66 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -13,6 +13,7 @@ :local ScriptName [ :jobname ]; # expected configuration version +:global CommitId "unknown"; :global ExpectedConfigVersion 133; # global variables not to be changed by user @@ -284,6 +285,7 @@ # get readable device info :set DeviceInfo do={ + :global CommitId; :global ExpectedConfigVersion; :global Identity; @@ -324,6 +326,8 @@ $RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \ ([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \ "RouterOS-Scripts:\n" . \ + [ $IfThenElse ($CommitId != "unknown") \ + ([ $FormatLine " Commit" [ :pick $CommitId 0 8 ] ] . "\n") ] . \ [ $FormatLine " Version" $ExpectedConfigVersion ]); } From 0199ea8884d9b45a184717bdbd5dccf829eb527d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Feb 2025 09:07:43 +0100 Subject: [PATCH 227/273] global-functions: $ScriptInstallUpdate: show commit id (if available) --- global-functions.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 71e5c66..204f824 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1105,6 +1105,7 @@ :local Scripts [ :toarray $1 ]; :local NewComment [ :tostr $2 ]; + :global CommitId; :global ExpectedConfigVersion; :global Identity; :global IDonate; @@ -1137,6 +1138,7 @@ } } + :local CommitIdBefore $CommitId; :local ExpectedConfigVersionBefore $ExpectedConfigVersion; :local ReloadGlobalFunctions false; :local ReloadGlobalConfig false; @@ -1251,6 +1253,10 @@ } } + :if ($CommitId != "unknown" && $CommitIdBefore != $CommitId) do={ + $LogPrint info $0 ("Updated to commit id: " . [ :pick $CommitId 0 8 ]); + } + :if ($ExpectedConfigVersionBefore > $ExpectedConfigVersion) do={ $LogPrint warning $0 ("The configuration version decreased from " . \ $ExpectedConfigVersionBefore . " to " . $ExpectedConfigVersion . \ From dafcc1a0cb8d18b191919c4876fa1db6c3fe2e27 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Feb 2025 17:49:42 +0100 Subject: [PATCH 228/273] global-functions: $RmFile: fix type safeguard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ups... đŸĢŖ The type is not just literal 'file' - but what ever type the file is, like 'backup', 'package', 'script', '.conf file', ... So let's match those types we do *not* want to remove. Fixes: https://github.com/eworm-de/routeros-scripts/issues/90 --- global-functions.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 204f824..221b1b5 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1054,12 +1054,12 @@ $LogPrint debug $0 ("Removing file: ". $FileName); - :if ([ :len [ /file/find where name=$FileName type!=file ] ] > 0) do={ + :if ([ :len [ /file/find where name=$FileName (type=directory or type=disk) ] ] > 0) do={ $LogPrint error $0 ("File '" . $FileName . "' is not a file."); :return false; } - :local File [ /file/find where name=$FileName type=file ]; + :local File [ /file/find where name=$FileName !(type=directory or type=disk) ]; :if ([ :len $File ] = 0) do={ $LogPrint debug $0 ("... which does not exist."); :return true; From 75633872aa8a09a328e2bef07211e182bceb2725 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 17 Feb 2025 11:45:02 +0100 Subject: [PATCH 229/273] global-functions: $DeviceInfo: also show commit info --- global-functions.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 221b1b5..c6625c1 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -12,8 +12,9 @@ :local ScriptName [ :jobname ]; -# expected configuration version +# Git commit id & info, expected configuration version :global CommitId "unknown"; +:global CommitInfo "unknown"; :global ExpectedConfigVersion 133; # global variables not to be changed by user @@ -286,6 +287,7 @@ # get readable device info :set DeviceInfo do={ :global CommitId; + :global CommitInfo; :global ExpectedConfigVersion; :global Identity; @@ -327,7 +329,7 @@ ([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \ "RouterOS-Scripts:\n" . \ [ $IfThenElse ($CommitId != "unknown") \ - ([ $FormatLine " Commit" [ :pick $CommitId 0 8 ] ] . "\n") ] . \ + ([ $FormatLine " Commit" ($CommitInfo . "/" . [ :pick $CommitId 0 8 ]) ] . "\n") ] . \ [ $FormatLine " Version" $ExpectedConfigVersion ]); } From 2c92c78b4647e43c44da567e98adee69b7857393 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 17 Feb 2025 11:47:26 +0100 Subject: [PATCH 230/273] global-functions: $ScriptInstallUpdate: also show commit info --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index c6625c1..f5fa5cb 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1108,6 +1108,7 @@ :local NewComment [ :tostr $2 ]; :global CommitId; + :global CommitInfo; :global ExpectedConfigVersion; :global Identity; :global IDonate; @@ -1256,7 +1257,7 @@ } :if ($CommitId != "unknown" && $CommitIdBefore != $CommitId) do={ - $LogPrint info $0 ("Updated to commit id: " . [ :pick $CommitId 0 8 ]); + $LogPrint info $0 ("Updated to commit: " . $CommitInfo . "/" . [ :pick $CommitId 0 8 ]); } :if ($ExpectedConfigVersionBefore > $ExpectedConfigVersion) do={ From 58da92e36a704a0bd5915451fbace686e8d9456d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 19 Feb 2025 22:21:03 +0100 Subject: [PATCH 231/273] global-functions: $WaitForFile: drop the warning on file handling breakage... ... but keep the workaround for now - just to be sure. --- global-functions.rsc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index f5fa5cb..99e52f8 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1682,7 +1682,6 @@ :global CleanFilePath; :global EitherOr; - :global LogPrintOnce; :global MAX; :set FileName [ $CleanFilePath $FileName ]; @@ -1701,10 +1700,7 @@ :do { /file/get $FileName; :return true; - } on-error={ - $LogPrintOnce warning $0 \ - ("Hit the infamous file handling breakage (SUP-179200) introduced with RouterOS 7.18beta2..."); - } + } on-error={ } :delay $Delay; :set Delay ($Delay * 3 / 2); } From cad104879cbc758717f6cbf18f2f1b8946078c19 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Feb 2025 14:49:30 +0100 Subject: [PATCH 232/273] mod/notification-telegram: simplify the queue... ... and pass http-data as a complete sting. --- mod/notification-telegram.rsc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 23ef942..be4a915 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -22,7 +22,6 @@ :global IsFullyConnected; :global LogPrint; - :global UrlEncode; :if ([ $IsFullyConnected ] = false) do={ $LogPrint debug $0 ("System is not fully connected, not flushing."); @@ -41,9 +40,7 @@ :do { :local Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-method=post \ ("https://api.telegram.org/bot" . ($Message->"tokenid") . "/sendMessage") \ - http-data=("chat_id=" . ($Message->"chatid") . "&disable_notification=" . ($Message->"silent") . \ - "&reply_to_message_id=" . ($Message->"replyto") . "&disable_web_page_preview=true" . \ - "&parse_mode=MarkdownV2&text=" . [ $UrlEncode ($Message->"text") ]) as-value ]->"data"); + http-data=($Message->"http-data") as-value ]->"data"); :set ($TelegramQueue->$Id); :set ($TelegramMessageIDs->[ :tostr ([ :deserialize from=json value=$Data ]->"result"->"message_id") ]) 1; } on-error={ @@ -145,6 +142,9 @@ (($LenSum - [ :len $Text ]) * 100 / $LenSum) . "%_!") "plain" "_" ]); } + :local HTTPData ("chat_id=" . $ChatId . "&disable_notification=" . ($Notification->"silent") . \ + "&reply_to_message_id=" . ($Notification->"replyto") . "&disable_web_page_preview=true" . \ + "&parse_mode=MarkdownV2"); :do { :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); @@ -152,9 +152,7 @@ } :local Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-method=post \ ("https://api.telegram.org/bot" . $TokenId . "/sendMessage") \ - http-data=("chat_id=" . $ChatId . "&disable_notification=" . ($Notification->"silent") . \ - "&reply_to_message_id=" . ($Notification->"replyto") . "&disable_web_page_preview=true" . \ - "&parse_mode=MarkdownV2&text=" . [ $UrlEncode $Text ]) as-value ]->"data"); + http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) as-value ]->"data"); :set ($TelegramMessageIDs->[ :tostr ([ :deserialize from=json value=$Data ]->"result"->"message_id") ]) 1; } on-error={ $LogPrint info $0 ("Failed sending Telegram notification! Queuing..."); @@ -165,8 +163,8 @@ :set Text ($Text . "\n" . [ $SymbolForNotification "alarm-clock" ] . \ [ $EscapeMD ("This message was queued since _" . [ /system/clock/get date ] . \ " " . [ /system/clock/get time ] . "_ and may be obsolete.") "plain" "_" ]); - :set ($TelegramQueue->[ :len $TelegramQueue ]) { chatid=$ChatId; tokenid=$TokenId; - text=$Text; silent=($Notification->"silent"); replyto=($Notification->"replyto") }; + :set ($TelegramQueue->[ :len $TelegramQueue ]) { tokenid=$TokenId; + http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) }; :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={ /system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \ on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;"); From a22b62f58803141a3055db046363f4d41b12ea83 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Feb 2025 14:57:26 +0100 Subject: [PATCH 233/273] mod/notification-telegram: support sending to group's topic... ... when a group has enabled the "Topics" feature. --- doc/mod/notification-telegram.md | 3 +++ global-config.rsc | 2 ++ mod/notification-telegram.rsc | 8 ++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md index b85d09c..8043716 100644 --- a/doc/mod/notification-telegram.md +++ b/doc/mod/notification-telegram.md @@ -58,6 +58,9 @@ Sending notifications to a group is possible as well. Add your bot and the *GetIDs Bot* to a group, then use the group's id (which starts with a dash) for `TelegramChatId`. Then remove *GetIDs Bot* from group. +Groups can enable the `Topics` feature. Use `TelegramThreadId` to send to a +specific topic in a group. + Usage and invocation -------------------- diff --git a/global-config.rsc b/global-config.rsc index b364a25..2524ded 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -33,6 +33,8 @@ :global TelegramChatId ""; #:global TelegramTokenId "123456:ABCDEF-GHI"; #:global TelegramChatId "12345678"; +# Use this to send notifications to a specific topic in group. +:global TelegramThreadId ""; # Using telegram-chat you have to define trusted chat ids (not group ids!) # or user names. Groups allow to chat with devices simultaneously. #:global TelegramChatIdsTrusted { diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index be4a915..d04893f 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -68,6 +68,8 @@ :global TelegramChatIdOverride; :global TelegramMessageIDs; :global TelegramQueue; + :global TelegramThreadId; + :global TelegramThreadIdOverride; :global TelegramTokenId; :global TelegramTokenIdOverride; @@ -108,6 +110,8 @@ :local ChatId [ $EitherOr ($Notification->"chatid") \ [ $EitherOr ($TelegramChatIdOverride->($Notification->"origin")) $TelegramChatId ] ]; + :local ThreadId [ $EitherOr ($Notification->"threadid") \ + [ $EitherOr ($TelegramThreadIdOverride->($Notification->"origin")) $TelegramThreadId ] ]; :local TokenId [ $EitherOr ($TelegramTokenIdOverride->($Notification->"origin")) $TelegramTokenId ]; :if ([ :len $TokenId ] = 0 || [ :len $ChatId ] = 0) do={ @@ -143,8 +147,8 @@ } :local HTTPData ("chat_id=" . $ChatId . "&disable_notification=" . ($Notification->"silent") . \ - "&reply_to_message_id=" . ($Notification->"replyto") . "&disable_web_page_preview=true" . \ - "&parse_mode=MarkdownV2"); + "&reply_to_message_id=" . ($Notification->"replyto") . "&message_thread_id=" . $ThreadId . \ + "&disable_web_page_preview=true&parse_mode=MarkdownV2"); :do { :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); From 757fa60e6f37cc684abec5582d1b6051f6ef8d6d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2025 10:46:25 +0100 Subject: [PATCH 234/273] telegram-chat: make $IsReply a boolean... ... and check for correct data type. We need this for a group with topic feature enabled, as that variable is set there, but is is an array. --- telegram-chat.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 10952a6..eacbbcb 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -97,7 +97,7 @@ :foreach Update in=($JSON->"result") do={ :set UpdateID ($Update->"update_id"); :local Message ($Update->"message"); - :local IsReply [ :len ($Message->"reply_to_message") ]; + :local IsReply ([ :typeof ($Message->"reply_to_message") ] = "string"); :local IsMyReply ($TelegramMessageIDs->[ :tostr ($Message->"reply_to_message"->"message_id") ]); :if (($IsMyReply = 1 || $TelegramChatOffset->0 > 0 || $Uptime > 5m) && $UpdateID >= $TelegramChatOffset->2) do={ :local Trusted false; @@ -130,7 +130,8 @@ " from update " . $UpdateID . "!"); :set Done true; } - :if ($Done = false && ($IsMyReply = 1 || ($IsReply = 0 && $TelegramChatActive = true)) && [ :len $Command ] > 0) do={ + :if ($Done = false && ($IsMyReply = 1 || ($IsReply = false && \ + $TelegramChatActive = true)) && [ :len $Command ] > 0) do={ :if ([ $ValidateSyntax $Command ] = true) do={ :local State ""; :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]); From 7928c5f0543765e27379e39bbaff6bdb19638971 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Feb 2025 15:31:34 +0100 Subject: [PATCH 235/273] telegram-chat: support reply in group's topic --- telegram-chat.rsc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index eacbbcb..07e3816 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -104,6 +104,7 @@ :local Chat ($Message->"chat"); :local From ($Message->"from"); :local Command ($Message->"text"); + :local ThreadId [ $IfThenElse ($Message->"is_topic_message") ($Message->"message_thread_id") "" ]; :foreach IdsTrusted in=($TelegramChatId, $TelegramChatIdsTrusted) do={ :if ($From->"id" = $IdsTrusted || $From->"username" = $IdsTrusted) do={ @@ -115,7 +116,8 @@ :local Done false; :if ($Command = "?") do={ $LogPrint info $ScriptName ("Sending notice for update " . $UpdateID . "."); - $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; replyto=($Message->"message_id"); \ + $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; \ + replyto=($Message->"message_id"); threadid=$ThreadId; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("Online" . [ $IfThenElse $TelegramChatActive " (and active!)" ] . ", awaiting your commands!") }); :set Done true; @@ -150,7 +152,8 @@ :set State ([ $SymbolForNotification "cross-mark" ] . "The command failed with an error!\n\n"); } :local Content ([ /file/read chunk-size=32768 file=$File as-value ]->"data"); - $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; replyto=($Message->"message_id"); \ + $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; \ + replyto=($Message->"message_id"); threadid=$ThreadId; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=([ $SymbolForNotification "gear" ] . "Command:\n" . $Command . "\n\n" . \ $State . [ $IfThenElse ([ :len $Content ] > 0) \ @@ -159,7 +162,8 @@ $RmDir "tmpfs/telegram-chat"; } else={ $LogPrint info $ScriptName ("The command from update " . $UpdateID . " failed syntax validation!"); - $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; replyto=($Message->"message_id"); \ + $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; \ + replyto=($Message->"message_id"); threadid=$ThreadId; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=([ $SymbolForNotification "gear" ] . "Command:\n" . $Command . "\n\n" . \ [ $SymbolForNotification "cross-mark" ] . "The command failed syntax validation!") }); @@ -171,7 +175,8 @@ " (ID " . $From->"id" . ") in update " . $UpdateID . "!"); :if ($Command ~ ("^! *" . [ $EscapeForRegEx $Identity ] . "\$")) do={ $LogPrint warning $ScriptName $MessageText; - $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; replyto=($Message->"message_id"); \ + $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=false; \ + replyto=($Message->"message_id"); threadid=$ThreadId; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("You are not trusted.") }); } else={ From e5de9de391283f64763ad16446fa2f6727191306 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2025 12:19:49 +0100 Subject: [PATCH 236/273] notify on support for Telegram group topics --- global-functions.rsc | 2 +- news-and-changes.rsc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 99e52f8..42782bc 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -15,7 +15,7 @@ # Git commit id & info, expected configuration version :global CommitId "unknown"; :global CommitInfo "unknown"; -:global ExpectedConfigVersion 133; +:global ExpectedConfigVersion 134; # global variables not to be changed by user :global GlobalFunctionsReady false; diff --git a/news-and-changes.rsc b/news-and-changes.rsc index 6f9e96e..a735ff7 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -58,6 +58,7 @@ 131="Enhanced certificate download to fallback to mkcert.org, so all (commonly trusted) root certificates are available now."; 132="Split off plugins from 'check-health', so the script works on all devices to monitor CPU and RAM. The supported plugins for sensors in hardware are installed automatically."; 133="Updated the default configuration for 'fw-addr-lists', deprecated lists were removed, a collective list was added."; + 134="Enhanced 'mod/notification-telegram' and 'telegram-chat' to support topics in groups."; }; # Migration steps to be applied on script updates From c33eb41c9cfb73e7e5b5ec7a3c37aa9e92ebc9cb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 18 Dec 2024 17:50:56 +0100 Subject: [PATCH 237/273] global-functions: $DeviceInfo: add license level, re-order --- global-functions.rsc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 42782bc..b3166dc 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -309,16 +309,19 @@ ([ $FormatLine "Location" ($Snmp->"location") ] . "\n") ] . \ [ $IfThenElse ([ :len ($Snmp->"contact") ] > 0) \ ([ $FormatLine "Contact" ($Snmp->"contact") ] . "\n") ] . \ - [ $FormatLine "Board name" ($Resource->"board-name") ] . "\n" . \ - [ $FormatLine "Architecture" ($Resource->"architecture-name") ] . "\n" . \ + "Hardware:\n" . \ + [ $FormatLine " Board" ($Resource->"board-name") ] . "\n" . \ + [ $FormatLine " Arch" ($Resource->"architecture-name") ] . "\n" . \ [ $IfThenElse ($RouterBoard->"routerboard" = true) \ - ([ $FormatLine "Model" ($RouterBoard->"model") ] . \ + ([ $FormatLine " Model" ($RouterBoard->"model") ] . \ [ $IfThenElse ([ :len ($RouterBoard->"revision") ] > 0) \ (" " . $RouterBoard->"revision") ] . "\n" . \ - [ $FormatLine "Serial number" ($RouterBoard->"serial-number") ] . "\n") ] . \ - [ $IfThenElse ([ :len ($License->"level") ] > 0) \ - ([ $FormatLine "License" ($License->"level") ] . "\n") ] . \ + [ $FormatLine " Serial" ($RouterBoard->"serial-number") ] . "\n") ] . \ + [ $IfThenElse ([ :len ($License->"nlevel") ] > 0) \ + ([ $FormatLine " License" ("level " . ($License->"nlevel")) ] . "\n") ] . \ "RouterOS:\n" . \ + [ $IfThenElse ([ :len ($License->"level") ] > 0) \ + ([ $FormatLine " License" ("level " . ($License->"level")) ] . "\n") ] . \ [ $FormatLine " Channel" ($Update->"channel") ] . "\n" . \ [ $FormatLine " Installed" ($Update->"installed-version") ] . "\n" . \ [ $IfThenElse ([ :typeof ($Update->"latest-version") ] != "nothing" && \ From 4eafcaa3ace2be0f17618c90c0d320647dfd8e38 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2025 21:26:52 +0100 Subject: [PATCH 238/273] telegram-chat: say hello when awaiting commands --- telegram-chat.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 07e3816..5db4860 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -119,7 +119,8 @@ $SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; \ replyto=($Message->"message_id"); threadid=$ThreadId; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ - message=("Online" . [ $IfThenElse $TelegramChatActive " (and active!)" ] . ", awaiting your commands!") }); + message=([ $IfThenElse ([ :len ($From->"first_name") ] > 0) ("Hello " . ($From->"first_name") . "!\n\n") ] . \ + "Online" . [ $IfThenElse $TelegramChatActive " (and active!)" ] . ", awaiting your commands!") }); :set Done true; } :if ($Done = false && [ :pick $Command 0 1 ] = "!") do={ From 53b13b295af835658dc4ef6192624b2ae898bab1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2025 21:33:08 +0100 Subject: [PATCH 239/273] mod/notification-telegram: introduce $GetTelegramChatId --- .../notification-telegram.d/getchatid.avif | Bin 0 -> 3896 bytes doc/mod/notification-telegram.md | 24 ++++++++----- global-functions.rsc | 2 +- mod/notification-telegram.rsc | 34 ++++++++++++++++++ news-and-changes.rsc | 1 + 5 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 doc/mod/notification-telegram.d/getchatid.avif diff --git a/doc/mod/notification-telegram.d/getchatid.avif b/doc/mod/notification-telegram.d/getchatid.avif new file mode 100644 index 0000000000000000000000000000000000000000..779296915de91a9b21e2f05685e34a1539d9c73e GIT binary patch literal 3896 zcmbVJc|4Tw7Jp|9Gh>OdZ)4v{hOzJKWG|7Wg+Um*Axp}deNQA*iVO)U43+F6AqrWt z6pds=B~;9v(eHQf{oKFqz32U$=X}rdoO8a<3jlzKS6EaqHXP>#P=#g#a9*eY9M;R) z5M>AeAccT)VOUy@DxyA~{`fx-0D^HIVSnSl?V(^?Sipe;qMiyk{~!;VX956VfEJ-D z>;(WY1XBG24`dGj&~Pd?#Nh%DRyfG;Q=N0P650)HxDv`Z$Uo>{GT%Ql)U;_N&WonB zLVg_n+@A&jaLB_m)Z<_zZKy9U7#~cvmbhS#AgblWg$AFaTB^`VP!BX!*@AJAxPu4` z2BTVLY&gm|UW66_I6Q*<@qr%xkiMEiA36tD&r;sDf6eH37llaAqcE zUKSQ!Wl=#<<^NeI9RLCbuz{###Q-n@M27%TdH`YSp7fvt`9p<9lnz4A0ENLBnWzO# zY_yl614HQO=^@ld2VJ7(0SJPgT@+==z;PT46${~1j?cRd6E|w;^YZq=`G$s_508k9x{!D| zDLExIE&WRV)q=unMc0e(lvmuXBve)3d-$lashQZ)`napRr?>BU|G$mS)Kel&vf6{o-c>XPanEeMY1eF&U0-=LIX}mz-2pVw&gkBWI zz;1XPiVfiqQ;vsm8s*(?=!A=_*llpR<3|~}CD4nKn>1<%%>FxK3I7+fe-ir_uW5jp z4n+NVbO=Bn_&S*Y{&BaF0e3OOpVM>d|wQdGhlWObE4x{~dGl1#%7j7&IBA?^hq9@EAMf(v}&82eQ zTMn5iEnHXAIh+X&b~@kx{d+BE!Tk`6B+QBHy1K5vmB@i}ToZvh^Q>)EyC}|p4*d-d zB6Mc%o+*EpCFVpWxKe6w*j^z1;|uNWeW9pbGi`@Gi!mI;4Ag;{fTP zp(X=}N8)R}x0NnZm*+hTgV;}ZhjRMP^eA4u6XRvtwZ%L%9I`v9&24>atSLoW8#Ds9?|^c66Fl8h92pY@;%y zCQ!nn?tJQ!zRP24)!Qr*D~!aFWfJd9X%Jn*2f^)H=r}o+Sj5WZ8{i|V%+!7>q$rM6 zAT)t9#<+OpGMR^u%g*6S2*FS9v+Iuga&Lu-a8r9?Ao#S3d}Mf&`T2 z_e)i@jG^lrT_oERws^EJ4pt>vwwiS}f^D~x&HGRtx}ODpMUlUd%k@N`wLHXapN2#T zf)AM)NVogW-*S4T-=r9X-3-6azmO=Jsm##_qW~u_u$099@?% z8)I@z)~A0t@vtBGy6jxxXmiH0THz_z2k~~KuXe4r<E$g21Vzz|w*m z07@Z>uv!ei+1e2s8^q0tk4rxBI{9_(vr`_?Lr`F|{ zZccfR9-i|=z>7}x(UJRXt(HFImkQpL&yT<%Z)7`X+j36#K6%nMV#IbVMO!dI58Q$>A>&!4h@B4OElQ`)lay+c&+r5EO<_Mvdfz_yy+K{kg z$0uiYN(_>tt6jTuHLvF;$=p3ABOVvYry&98Y7*vma=LzA-YDEyNamDyc#53azWyV# zpmXt=?+2f# zs?s3?0x|8WQm4C+phNr#pRURcLkRNiz)EN-NoTWkGwc}Dw#x5@3`|v4$`m`m2-lFr>%28EHmp#dW47vt%qCV!IBpld4P5zj?9LSgy26=0 zwfuWHkj}#bbF>i`UdyvmQ>7!4_xwu&ndRjw9I|S#F??lUeJs5amf-fKhk79bu_c%v@a| zBXqj&RoYf*C~>RX-l|#IT+Hz-*{x*jhq!q%ET5fGQwljGE2wj7o`fsq=Sdr3(G6jb zw_10cbCXUdrB_DI2Kwua&(~%rXa>I1_$+HC;0N!;bHL}lw1hfuW{dpr3U)f=1}m?z zM`dv(<~>VZQ>;w0bILAW+MAfgTKW-H5iB=k1}ap| z^VGez7o{5}CG4@R`cCui7WiQ+SJg`k^tJONRbg%5Y% z&gbgI6&RR*{LN@CwY`XXJy6%}t;{&6*x$00lwlh48|W^F~k&M*4e zWly<$X|D0fFY?kAukRc#`#$qnEmOORBGU4F;b##bhSol9pYZ&qI#~3|t&4^glOZ;4 zk8I=VBA371=+WLT@SMH&WT(9Dm)9;7Wn&TmxJ`|&QkLEYl{hO}g-iDT%#REa9JbEu zvVGZIn-O_VJ^I~3a8?#2g_Km2+plMH_0zKM*NRl$)Kot?t`pby8&ABc5%ELlm0s=? z>ceV|3R~9NONUW1YcXbeGdGb#x3(6K^{F$HW93g9l-tGKjXK$Q=KZF9^m^R$_dCg_ z=$D=~HKt0&DUZ>c%@c?$7N^aeW&FFW%LS^^+XC8chk%n4)B^ssgQ1aTK z+WP31k`CJ`t2KkM+^~w!r=8jc+62{hwKc~3V=wt8?1FvwQ5c^LF}dw|hLE8x-r7Qb zC&LmXmqu*V2kRR#;0aej2Ml>~WAw^OP)dYzorsvzv@uV`Ob7fosHLWda7I?JGo0-n zM?+%0`g`qL?u+|N-BXA4mDsw9e(0X6!&@L(n%ZJV>YprKG3EBtlpJ_A>c$rqJli~M zPikvKkF?%AFC6C+2&reB(J0fO8Vu8Sn6ugy>NRx*pKqlMjuw``G}`Sw+h@{T$b(s` zuuMM^;?|e#mcevK8yo*g?`YFkffRgJjB(F(rMTKNUr6FBMIY98J)-+SHLgd)8~6Xo{UO}5R1XmToG zCnSAix+m}UePrg@%S?)PPV!eF7>~zkEv0RQtB%|kkDnLSx_owZcxz^5uDy1vp@V|&!>XuY$1kV_Pgs#xK<1uu|k3fL?1rsf}dTZkB73xjO3Lq zH<$tjuhlL{gL|s6LM0i$4D|=xcGg8$gLEw=PnjQQ9XQS}9cBOB&nF%!^3+^a%lq9L zO8VLjg%&{$BB8DVHugBr8y?7F$6>P^xE+>@0pd{tUlw9i;)UoigknML3 z@%b$`NsVc1&H!`nD@6u=OU=e-)+RNp$ahbHcfa2A3%u}V@J8em?FHEKZ}d9KMw=kF zTffMRtn9OciH?ealxRXhhb4u6_h!BMF1|l@%4aORqSKXk4pjGCy+mKajpN2cdRq-& z2Xf==8mW4hL8_kb4oisQj>>9`R}g40xa%QWd->9)N>7ujKW1;Z=g#13CY3jlgYgW} z!A>kvbsgQ8vMh)(*YROFG5lO=+}+xF8B00bk())D0w1O21?kh+)7SM!D_jNJpWP? zr2s$c>Qa4*;GmM*kqhsx>`HuqkME â„šī¸ **Info**: Copy relevant configuration from @@ -54,9 +61,10 @@ reload the configuration. ### Notifications to a group -Sending notifications to a group is possible as well. Add your bot and the -*GetIDs Bot* to a group, then use the group's id (which starts with a dash) -for `TelegramChatId`. Then remove *GetIDs Bot* from group. +Sending notifications to a group is possible as well. Add your bot to a group +and make it an admin (required for read access!) and send a message and run +`$GetTelegramChatId` again. Then use that chat id (which starts with a dash) +for `TelegramChatId`. Groups can enable the `Topics` feature. Use `TelegramThreadId` to send to a specific topic in a group. diff --git a/global-functions.rsc b/global-functions.rsc index b3166dc..43cd7f0 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -15,7 +15,7 @@ # Git commit id & info, expected configuration version :global CommitId "unknown"; :global CommitInfo "unknown"; -:global ExpectedConfigVersion 134; +:global ExpectedConfigVersion 135; # global variables not to be changed by user :global GlobalFunctionsReady false; diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index d04893f..7782fcf 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -10,6 +10,7 @@ # https://rsc.eworm.de/doc/mod/notification-telegram.md :global FlushTelegramQueue; +:global GetTelegramChatId; :global NotificationFunctions; :global PurgeTelegramQueue; :global SendTelegram; @@ -58,6 +59,39 @@ :global ExitError; $ExitError false $0; } } +# get the chat id +:set GetTelegramChatId do={ :do { + :global TelegramTokenId; + + :global CertificateAvailable; + :global LogPrint; + + :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ + $LogPrint warning $0 ("Downloading required certificate failed."); + :return false; + } + + :local Data; + :do { + :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \ + ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=0" . \ + "&allowed_updates=%5B%22message%22%5D") as-value ]->"data"); + } on-error={ + $LogPrint warning $0 ("Fetching data failed!"); + :return false; + } + + :local JSON [ :deserialize from=json value=$Data ]; + :foreach Update in=($JSON->"result") do={ + $LogPrint info $0 ("The chat id is: " . ($Update->"message"->"chat"->"id")); + :return true; + } + + $LogPrint info $0 ("No message received."); +} on-error={ + :global ExitError; $ExitError false $0; +} } + # send notification via telegram - expects one array argument :set ($NotificationFunctions->"telegram") do={ :local Notification $1; diff --git a/news-and-changes.rsc b/news-and-changes.rsc index a735ff7..459326f 100644 --- a/news-and-changes.rsc +++ b/news-and-changes.rsc @@ -59,6 +59,7 @@ 132="Split off plugins from 'check-health', so the script works on all devices to monitor CPU and RAM. The supported plugins for sensors in hardware are installed automatically."; 133="Updated the default configuration for 'fw-addr-lists', deprecated lists were removed, a collective list was added."; 134="Enhanced 'mod/notification-telegram' and 'telegram-chat' to support topics in groups."; + 135="Introduced helper function '\$GetTelegramChatId' for 'mod/notification-telegram' which helps retrieve information."; }; # Migration steps to be applied on script updates From f6c2225f68fae8494d620dca0fc41b50a0450977 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 13:37:57 +0100 Subject: [PATCH 240/273] check-certificates: catch and ignore import error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hmm... 🤨 When was that runtime error introduced? I *think* it worked before. --- check-certificates.rsc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 0907395..94f23a7 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -59,10 +59,12 @@ :local DecryptionFailed true; :foreach PassPhrase in=$CertRenewPass do={ - :local Result [ /certificate/import file-name=$CertFileName passphrase=$PassPhrase as-value ]; - :if ($Result->"decryption-failures" = 0) do={ - :set DecryptionFailed false; - } + :do { + :local Result [ /certificate/import file-name=$CertFileName passphrase=$PassPhrase as-value ]; + :if ($Result->"decryption-failures" = 0) do={ + :set DecryptionFailed false; + } + } on-error={ } } $RmFile $CertFileName; From a6d4e7e82cc9870c6cfd1e0ee9724eb6129ce5ab Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 18:03:17 +0100 Subject: [PATCH 241/273] check-certificates: drop dot from type... ... and add it in file name. --- check-certificates.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 94f23a7..20ac2e2 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -50,8 +50,8 @@ :local Return false; - :foreach Type in={ ".pem"; ".p12" } do={ - :local CertFileName ([ $UrlEncode $FetchName ] . $Type); + :foreach Type in={ "pem"; "p12" } do={ + :local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type); :do { /tool/fetch check-certificate=yes-without-crl http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \ ($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value; From 3d40b4419d47f41edf5059c00c1ab575f49c6da1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 13:40:12 +0100 Subject: [PATCH 242/273] check-certificates: add more debug output --- check-certificates.rsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 20ac2e2..6862015 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -58,10 +58,12 @@ $WaitForFile $CertFileName; :local DecryptionFailed true; - :foreach PassPhrase in=$CertRenewPass do={ + :foreach I,PassPhrase in=$CertRenewPass do={ :do { + $LogPrint debug $ScriptName ("Trying " . $I . ". passphrase... "); :local Result [ /certificate/import file-name=$CertFileName passphrase=$PassPhrase as-value ]; :if ($Result->"decryption-failures" = 0) do={ + $LogPrint debug $ScriptName ("Success!"); :set DecryptionFailed false; } } on-error={ } From 512c54bd590503af27e754c5c65c34b5307cf9c9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 13:55:09 +0100 Subject: [PATCH 243/273] check-certificates: ... and even more --- check-certificates.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check-certificates.rsc b/check-certificates.rsc index 6862015..6dff9ba 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -52,6 +52,9 @@ :foreach Type in={ "pem"; "p12" } do={ :local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type); + $LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \ + "' (file '" . $CertFileName . "')..."); + :do { /tool/fetch check-certificate=yes-without-crl http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \ ($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value; From e833dfcf25175fb1d5c652dcf898c6332ce70404 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 13:51:25 +0100 Subject: [PATCH 244/273] check-certificates: simplify return from function... ... and also break earch on success. --- check-certificates.rsc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 6dff9ba..5065c33 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -48,8 +48,6 @@ :global UrlEncode; :global WaitForFile; - :local Return false; - :foreach Type in={ "pem"; "p12" } do={ :local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type); $LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \ @@ -84,13 +82,13 @@ $CertificateNameByCN [ /certificate/get $CertInChain common-name ]; } - :set Return true; + :return true; } on-error={ $LogPrint debug $ScriptName ("Could not download certificate file '" . $CertFileName . "'."); } } - :return $Return; + :return false; } :local FormatInfo do={ From 14195c51ca381063789ca58c760d70037328e600 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 18:25:58 +0100 Subject: [PATCH 245/273] check-certificates: try PKCS#12 before PEM... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as that is more likely to have a private key. Is that true? 🤨 --- check-certificates.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index 5065c33..be8e4df 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -48,7 +48,7 @@ :global UrlEncode; :global WaitForFile; - :foreach Type in={ "pem"; "p12" } do={ + :foreach Type in={ "p12"; "pem" } do={ :local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type); $LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \ "' (file '" . $CertFileName . "')..."); From b11be59b0824efac6df128fde46a529ced14a2d0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 27 Feb 2025 10:44:53 +0100 Subject: [PATCH 246/273] README: quote the certificate file name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a76d50f..fae6986 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ file to your MikroTik device. Then we import the certificate. - /certificate/import file-name=isrg-root-x2.pem passphrase=""; + /certificate/import file-name="isrg-root-x2.pem" passphrase=""; Do not worry that the command is not shown - that happens because it contains a sensitive property, the passphrase. From e2fe653035ca2217dc56235de780f72dbb790e1d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 20:16:12 +0100 Subject: [PATCH 247/273] mod/notification-telegram: $GetTelegramChatId: use last message --- mod/notification-telegram.rsc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 7782fcf..4528615 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -82,12 +82,15 @@ } :local JSON [ :deserialize from=json value=$Data ]; - :foreach Update in=($JSON->"result") do={ - $LogPrint info $0 ("The chat id is: " . ($Update->"message"->"chat"->"id")); - :return true; + :local Count [ :len ($JSON->"result") ]; + + :if ($Count = 0) do={ + $LogPrint info $0 ("No message received."); + :return false; } - $LogPrint info $0 ("No message received."); + :local Message ($JSON->"result"->($Count - 1)->"message"); + $LogPrint info $0 ("The chat id is: " . ($Message->"chat"->"id")); } on-error={ :global ExitError; $ExitError false $0; } } From f5189b8bd7ca01fb6e26414960764960a03066c4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 27 Feb 2025 10:45:30 +0100 Subject: [PATCH 248/273] INITIAL-COMMANDS: quote the certificate file name --- INITIAL-COMMANDS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INITIAL-COMMANDS.md b/INITIAL-COMMANDS.md index 424ef32..8b64d28 100644 --- a/INITIAL-COMMANDS.md +++ b/INITIAL-COMMANDS.md @@ -19,7 +19,7 @@ Run the complete base installation: { /tool/fetch "https://git.eworm.de/cgit/routeros-scripts/plain/certs/ISRG-Root-X2.pem" dst-path="isrg-root-x2.pem" as-value; :delay 1s; - /certificate/import file-name=isrg-root-x2.pem passphrase=""; + /certificate/import file-name="isrg-root-x2.pem" passphrase=""; :if ([ :len [ /certificate/find where fingerprint="69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470" ] ] != 1) do={ :error "Something is wrong with your certificates!"; }; From 0c4fb42616f8015dd128ec7df1d1afce590d26ed Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Feb 2025 20:18:12 +0100 Subject: [PATCH 249/273] mod/notification-telegram: $GetTelegramChatId: give thead id... ... if message was sent to group's topic. --- mod/notification-telegram.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index 4528615..68e913f 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -91,6 +91,9 @@ :local Message ($JSON->"result"->($Count - 1)->"message"); $LogPrint info $0 ("The chat id is: " . ($Message->"chat"->"id")); + :if (($Message->"is_topic_message") = true) do={ + $LogPrint info $0 ("The thread id is: " . ($Message->"message_thread_id")); + } } on-error={ :global ExitError; $ExitError false $0; } } From 33c02e06092eded4b3344a6eb22742c9be531fb2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Mar 2025 09:10:54 +0100 Subject: [PATCH 250/273] ipv6-update: ignore if prefix is no longer valid --- ipv6-update.rsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ipv6-update.rsc b/ipv6-update.rsc index c6e3d65..beccde0 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -20,7 +20,9 @@ :global ScriptLock; :local NaAddress $"na-address"; + :local NaValid $"na-valid"; :local PdPrefix $"pd-prefix"; + :local PdValid $"pd-valid"; :if ([ $ScriptLock $ScriptName ] = false) do={ :set ExitOK true; @@ -39,6 +41,12 @@ :error false; } + :if ($PdValid != 1) do={ + $LogPrint info $ScriptName ("The prefix " . $PdPrefix . " is no longer valid. Ignoring."); + :set ExitOK true; + :error false; + } + :local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ]; :if ([ :len [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={ /ipv6/firewall/address-list/add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool) dynamic=yes; From 469f783a92c8e67088d70572157ff4cd7d47fcd8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Mar 2025 09:12:43 +0100 Subject: [PATCH 251/273] ipv6-update: check for availability of both variables --- ipv6-update.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipv6-update.rsc b/ipv6-update.rsc index beccde0..94bd1bc 100644 --- a/ipv6-update.rsc +++ b/ipv6-update.rsc @@ -35,7 +35,7 @@ :error false; } - :if ([ :typeof $PdPrefix ] = "nothing") do={ + :if ([ :typeof $PdPrefix ] = "nothing" || [ :typeof $PdValid ] = "nothing") do={ $LogPrint error $ScriptName ("This script is supposed to run from ipv6 dhcp-client."); :set ExitOK true; :error false; From 3ccaafd1b38f4335aa28361778aa37db2ca22d5f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 00:28:01 +0100 Subject: [PATCH 252/273] global-functions: $ScriptInstallUpdate: move code into block --- global-functions.rsc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 43cd7f0..8fcd56d 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1163,7 +1163,12 @@ } } - :if (!($ScriptInfo->"ignore" = true)) do={ + :do { + :if ($ScriptInfo->"ignore" = true) do={ + $LogPrint debug $0 ("Ignoring script '" . $ScriptVal->"name" . "', as requested."); + :error true; + } + :do { :local BaseUrl [ $EitherOr ($ScriptInfo->"base-url") $ScriptUpdatesBaseUrl ]; :local UrlSuffix [ $EitherOr ($ScriptInfo->"url-suffix") $ScriptUpdatesUrlSuffix ]; @@ -1182,10 +1187,9 @@ } else={ $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "'!"); } + :error false; } - } - :do { :if ([ :len $SourceNew ] = 0) do={ $LogPrint debug $0 ("No update for script '" . $ScriptVal->"name" . "'."); :error false; From 0c1d96f89dfb4d209b0848d5ac2d81a640e0f056 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 00:18:43 +0100 Subject: [PATCH 253/273] global-functions: $ScriptInstallUpdate: get and compare checksums MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file 'checksums.json' is generated when deploying to my web server... This should speed up the update a lot as it reduces downloads to a minimum. 🎉😁 --- global-functions.rsc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 8fcd56d..8405c92 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1150,6 +1150,14 @@ :local ReloadGlobalConfig false; :local DeviceMode [ /system/device-mode/get ]; + :local CheckSums ({}); + :do { + :local Url ($ScriptUpdatesBaseUrl . "checksums.json" . $ScriptUpdatesUrlSuffix); + $LogPrint debug $0 ("Fetching checksums from url: " . $Url); + :set CheckSums [ :deserialize from=json ([ /tool/fetch check-certificate=yes-without-crl \ + http-header-field=({ [ $FetchUserAgentStr $0 ] }) $Url output=user as-value ]->"data") ]; + } on-error={ } + :foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={ :local ScriptVal [ /system/script/get $Script ]; :local ScriptInfo [ $ParseKeyValueStore ($ScriptVal->"comment") ]; @@ -1169,6 +1177,11 @@ :error true; } + :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = ($CheckSums->($ScriptVal->"name"))) do={ + $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring."); + :error true; + } + :do { :local BaseUrl [ $EitherOr ($ScriptInfo->"base-url") $ScriptUpdatesBaseUrl ]; :local UrlSuffix [ $EitherOr ($ScriptInfo->"url-suffix") $ScriptUpdatesUrlSuffix ]; From 10374afc182cd8b08e07a3d45890518e8b6be73c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 01:37:42 +0100 Subject: [PATCH 254/273] global-functions: $ScriptInstallUpdate: support checksums for CRLF scripts --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 8405c92..d883aa0 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1177,7 +1177,8 @@ :error true; } - :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = ($CheckSums->($ScriptVal->"name"))) do={ + :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = ($CheckSums->($ScriptVal->"name")) || \ + [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = ($CheckSums->($ScriptVal->"name"))) do={ $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring."); :error true; } From c9de6d85790897a945910316a14db16b0435c41e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 01:39:59 +0100 Subject: [PATCH 255/273] global-functions: $ScriptInstallUpdate: put checksum into variable --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index d883aa0..a9fa938 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1177,8 +1177,9 @@ :error true; } - :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = ($CheckSums->($ScriptVal->"name")) || \ - [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = ($CheckSums->($ScriptVal->"name"))) do={ + :local CheckSum ($CheckSums->($ScriptVal->"name")); + :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = $CheckSum || \ + [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={ $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring."); :error true; } From b13360e4b86838d95cd8c9a1a4e2ea8d757dbb0f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 01:53:04 +0100 Subject: [PATCH 256/273] global-functions: $ScriptInstallUpdate: simplify check This one should suffice... --- global-functions.rsc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index a9fa938..4c777a1 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1178,8 +1178,7 @@ } :local CheckSum ($CheckSums->($ScriptVal->"name")); - :if ([ :convert transform=md5 to=hex ($ScriptVal->"source") ] = $CheckSum || \ - [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={ + :if ([ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={ $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring."); :error true; } From 1b46a5fd9bc69f4d609b28e7ff8d36717a3b9a8f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Mar 2025 08:55:06 +0100 Subject: [PATCH 257/273] global-functions: $ScriptInstallUpdate: checksum only for same source So ignore if script is fetched from different base or with different suffix. --- global-functions.rsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 4c777a1..da31165 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1178,7 +1178,8 @@ } :local CheckSum ($CheckSums->($ScriptVal->"name")); - :if ([ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={ + :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ + [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={ $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring."); :error true; } From e341e1c30ca4ff8b87bc757cc5c0effbc50a7ea6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 15:02:31 +0100 Subject: [PATCH 258/273] global-functions: introduce $LogPrintVerbose ... ... which is a declared function, but has no code, intentionally. It can be called as a no-op by default. If you want this output set the function to be the same as $LogPrint: :set LogPrintVerbose $LogPrint; --- global-functions.rsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index da31165..911ff6a 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -55,6 +55,7 @@ :global IsTimeSync; :global LogPrint; :global LogPrintOnce; +:global LogPrintVerbose; :global MAX; :global MIN; :global MkDir; @@ -848,6 +849,8 @@ :return true; } +# The function $LogPrintVerbose is declared, but has no code, intentionally. + # get max value :set MAX do={ :if ($1 > $2) do={ :return $1; } From 6d718ec9877c3ecfc10681e85d050d15ed4d4b80 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 14:38:35 +0100 Subject: [PATCH 259/273] fw-addr-lists: use $LogPrintVerbose ... ... to reduce debug output and speed up execution. --- fw-addr-lists.rsc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index d41dc04..af8c65d 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -24,6 +24,7 @@ :global HumanReadableNum; :global LogPrint; :global LogPrintOnce; + :global LogPrintVerbose; :global ScriptLock; :global WaitFullyConnected; @@ -120,14 +121,14 @@ list=$FwListName comment=$ListComment ] do={ :local Address [ /ip/firewall/address-list/get $Entry address ]; :if ([ :typeof ($IPv4Addresses->$Address) ] = "time") do={ - $LogPrint debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ "' with " . ($IPv4Addresses->$Address) . ": " . $Address); /ip/firewall/address-list/set $Entry timeout=($IPv4Addresses->$Address); :set ($IPv4Addresses->$Address); :set CntRenew ($CntRenew + 1); } else={ :if ($Failure = false) do={ - $LogPrint debug $ScriptName ("Removing IPv4 address from list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Removing IPv4 address from list '" . $FwListName . \ "': " . $Address); /ip/firewall/address-list/remove $Entry; :set CntRemove ($CntRemove + 1); @@ -139,14 +140,14 @@ list=$FwListName comment=$ListComment ] do={ :local Address [ /ipv6/firewall/address-list/get $Entry address ]; :if ([ :typeof ($IPv6Addresses->$Address) ] = "time") do={ - $LogPrint debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ "' with " . ($IPv6Addresses->$Address) . ": " . $Address); /ipv6/firewall/address-list/set $Entry timeout=($IPv6Addresses->$Address); :set ($IPv6Addresses->$Address); :set CntRenew ($CntRenew + 1); } else={ :if ($Failure = false) do={ - $LogPrint debug $ScriptName ("Removing IPv6 address from list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Removing IPv6 address from list '" . $FwListName . \ "': " . $Address); /ipv6/firewall/address-list/remove $Entry; :set CntRemove ($CntRemove + 1); @@ -155,7 +156,7 @@ } :foreach Address,Timeout in=$IPv4Addresses do={ - $LogPrint debug $ScriptName ("Adding IPv4 address to list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Adding IPv4 address to list '" . $FwListName . \ "' with " . $Timeout . ": " . $Address); :do { /ip/firewall/address-list/add list=$FwListName comment=$ListComment \ @@ -169,7 +170,7 @@ } :foreach Address,Timeout in=$IPv6Addresses do={ - $LogPrint debug $ScriptName ("Adding IPv6 address to list '" . $FwListName . \ + $LogPrintVerbose debug $ScriptName ("Adding IPv6 address to list '" . $FwListName . \ "' with " . $Timeout . ": " . $Address); :do { /ipv6/firewall/address-list/add list=$FwListName comment=$ListComment \ From 7be26a07125b9c946859560bd59323f84feb9494 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 14:54:38 +0100 Subject: [PATCH 260/273] DEBUG: add info on $LogPrintVerbose --- DEBUG.md | 14 ++++++++++++++ global-functions.rsc | 1 + 2 files changed, 15 insertions(+) diff --git a/DEBUG.md b/DEBUG.md index 3d7f025..d5e9beb 100644 --- a/DEBUG.md +++ b/DEBUG.md @@ -44,6 +44,20 @@ instead. Disable or remote that setting to restore regular logging. +## Verbose output + +Specific scripts can generate huge amount of output. These do use a function +`$LogPrintVerbose`, which is declared, but has no code, intentionally. + +If you *really* want that output set the function to be the same as +`$LogPrint`: + + :set LogPrintVerbose $LogPrint; + +To revert that change just run: + + :set LogPrintVerbose; + --- [âŦ…ī¸ Go back to main README](README.md) [âŦ†ī¸ Go back to top](#top) diff --git a/global-functions.rsc b/global-functions.rsc index 911ff6a..8ae7bb8 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -850,6 +850,7 @@ } # The function $LogPrintVerbose is declared, but has no code, intentionally. +# https://rsc.eworm.de/DEBUG.md#verbose-output # get max value :set MAX do={ From fb343c99e399d679f3e2a22e76c14a5899024319 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 22:59:31 +0100 Subject: [PATCH 261/273] fw-addr-lists: put timeout into variable --- fw-addr-lists.rsc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index af8c65d..331d2c6 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -120,10 +120,11 @@ :foreach Entry in=[ /ip/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ip/firewall/address-list/get $Entry address ]; - :if ([ :typeof ($IPv4Addresses->$Address) ] = "time") do={ + :local TimeOut ($IPv4Addresses->$Address); + :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ - "' with " . ($IPv4Addresses->$Address) . ": " . $Address); - /ip/firewall/address-list/set $Entry timeout=($IPv4Addresses->$Address); + "' with " . $TimeOut . ": " . $Address); + /ip/firewall/address-list/set $Entry timeout=$TimeOut; :set ($IPv4Addresses->$Address); :set CntRenew ($CntRenew + 1); } else={ @@ -139,10 +140,11 @@ :foreach Entry in=[ /ipv6/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ipv6/firewall/address-list/get $Entry address ]; - :if ([ :typeof ($IPv6Addresses->$Address) ] = "time") do={ + :local TimeOut ($IPv6Addresses->$Address); + :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ - "' with " . ($IPv6Addresses->$Address) . ": " . $Address); - /ipv6/firewall/address-list/set $Entry timeout=($IPv6Addresses->$Address); + "' with " . $TimeOut . ": " . $Address); + /ipv6/firewall/address-list/set $Entry timeout=$TimeOut; :set ($IPv6Addresses->$Address); :set CntRenew ($CntRenew + 1); } else={ From ea6de35699a5b62dfffcc583c1a7181e1a6a688f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 23:00:50 +0100 Subject: [PATCH 262/273] fw-addr-lists: do not clean up Cleanup is important on renew (so the script does not attempt to re-add), but we do not care here. --- fw-addr-lists.rsc | 2 -- 1 file changed, 2 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 331d2c6..70893e3 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -163,7 +163,6 @@ :do { /ip/firewall/address-list/add list=$FwListName comment=$ListComment \ address=$Address timeout=$Timeout; - :set ($IPv4Addresses->$Address); :set CntAdd ($CntAdd + 1); } on-error={ $LogPrint warning $ScriptName ("Failed to add IPv4 address to list '" . $FwListName . \ @@ -177,7 +176,6 @@ :do { /ipv6/firewall/address-list/add list=$FwListName comment=$ListComment \ address=$Address timeout=$Timeout; - :set ($IPv6Addresses->$Address); :set CntAdd ($CntAdd + 1); } on-error={ $LogPrint warning $ScriptName ("Failed to add IPv6 address to list '" . $FwListName . \ From 2f55bfaf009d726e1174b50887fdb8f9b4b57573 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Mar 2025 12:21:22 +0100 Subject: [PATCH 263/273] fw-addr-lists: strip cidr for host addresses This makes sure the addresses match later when we read them from address-list for renew. --- fw-addr-lists.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 70893e3..fc53795 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -101,10 +101,16 @@ } :do { :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={ + :if ($Address ~ "/32\$") do={ + :set Address [ :pick $Address 0 ([ :len $Address ] - 3) ]; + } :set ($IPv4Addresses->$Address) $TimeOut; :error true; } :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={ + :if ($Address ~ "/128\$") do={ + :set Address [ :pick $Address 0 ([ :len $Address ] - 4) ]; + } :set ($IPv6Addresses->$Address) $TimeOut; :error true; } From e148df9e573801803e35d8dfaef277f571952fdc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Mar 2025 23:05:45 +0100 Subject: [PATCH 264/273] fw-addr-lists: put addresses into "branches"... ... effectively adding another layer and some complexity, but: The addresses are sorted inside the array, and sorting less addresses in a branch saves a lot of processing power. So this is a lot faster now... --- fw-addr-lists.rsc | 65 +++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index fc53795..a97f7ed 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -100,23 +100,24 @@ :set Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr")); } :do { + :local Branch [ :pick $Address 0 1 ]; :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={ :if ($Address ~ "/32\$") do={ :set Address [ :pick $Address 0 ([ :len $Address ] - 3) ]; } - :set ($IPv4Addresses->$Address) $TimeOut; + :set ($IPv4Addresses->$Branch->$Address) $TimeOut; :error true; } :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={ :if ($Address ~ "/128\$") do={ :set Address [ :pick $Address 0 ([ :len $Address ] - 4) ]; } - :set ($IPv6Addresses->$Address) $TimeOut; + :set ($IPv6Addresses->$Branch->$Address) $TimeOut; :error true; } :if ($Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={ - :set ($IPv4Addresses->$Address) $TimeOut; - :set ($IPv6Addresses->$Address) $TimeOut; + :set ($IPv4Addresses->$Branch->$Address) $TimeOut; + :set ($IPv6Addresses->$Branch->$Address) $TimeOut; :error true; } } on-error={ } @@ -126,12 +127,13 @@ :foreach Entry in=[ /ip/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ip/firewall/address-list/get $Entry address ]; - :local TimeOut ($IPv4Addresses->$Address); + :local Branch [ :pick $Address 0 1 ]; + :local TimeOut ($IPv4Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ "' with " . $TimeOut . ": " . $Address); /ip/firewall/address-list/set $Entry timeout=$TimeOut; - :set ($IPv4Addresses->$Address); + :set ($IPv4Addresses->$Branch->$Address); :set CntRenew ($CntRenew + 1); } else={ :if ($Failure = false) do={ @@ -146,12 +148,13 @@ :foreach Entry in=[ /ipv6/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ipv6/firewall/address-list/get $Entry address ]; - :local TimeOut ($IPv6Addresses->$Address); + :local Branch [ :pick $Address 0 1 ]; + :local TimeOut ($IPv6Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ "' with " . $TimeOut . ": " . $Address); /ipv6/firewall/address-list/set $Entry timeout=$TimeOut; - :set ($IPv6Addresses->$Address); + :set ($IPv6Addresses->$Branch->$Address); :set CntRenew ($CntRenew + 1); } else={ :if ($Failure = false) do={ @@ -163,29 +166,35 @@ } } - :foreach Address,Timeout in=$IPv4Addresses do={ - $LogPrintVerbose debug $ScriptName ("Adding IPv4 address to list '" . $FwListName . \ - "' with " . $Timeout . ": " . $Address); - :do { - /ip/firewall/address-list/add list=$FwListName comment=$ListComment \ - address=$Address timeout=$Timeout; - :set CntAdd ($CntAdd + 1); - } on-error={ - $LogPrint warning $ScriptName ("Failed to add IPv4 address to list '" . $FwListName . \ - "': " . $Address); + :foreach BranchName,Branch in=$IPv4Addresses do={ + $LogPrintVerbose debug $ScriptName ("Handling branch: " . $BranchName); + :foreach Address,Timeout in=$Branch do={ + $LogPrintVerbose debug $ScriptName ("Adding IPv4 address to list '" . $FwListName . \ + "' with " . $Timeout . ": " . $Address); + :do { + /ip/firewall/address-list/add list=$FwListName comment=$ListComment \ + address=$Address timeout=$Timeout; + :set CntAdd ($CntAdd + 1); + } on-error={ + $LogPrint warning $ScriptName ("Failed to add IPv4 address to list '" . $FwListName . \ + "': " . $Address); + } } } - :foreach Address,Timeout in=$IPv6Addresses do={ - $LogPrintVerbose debug $ScriptName ("Adding IPv6 address to list '" . $FwListName . \ - "' with " . $Timeout . ": " . $Address); - :do { - /ipv6/firewall/address-list/add list=$FwListName comment=$ListComment \ - address=$Address timeout=$Timeout; - :set CntAdd ($CntAdd + 1); - } on-error={ - $LogPrint warning $ScriptName ("Failed to add IPv6 address to list '" . $FwListName . \ - "': " . $Address); + :foreach BranchName,Branch in=$IPv6Addresses do={ + $LogPrintVerbose debug $ScriptName ("Handling branch: " . $BranchName); + :foreach Address,Timeout in=$Branch do={ + $LogPrintVerbose debug $ScriptName ("Adding IPv6 address to list '" . $FwListName . \ + "' with " . $Timeout . ": " . $Address); + :do { + /ipv6/firewall/address-list/add list=$FwListName comment=$ListComment \ + address=$Address timeout=$Timeout; + :set CntAdd ($CntAdd + 1); + } on-error={ + $LogPrint warning $ScriptName ("Failed to add IPv6 address to list '" . $FwListName . \ + "': " . $Address); + } } } From d71ea804b077d35183df318fb305b213fb961d27 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Mar 2025 20:35:36 +0100 Subject: [PATCH 265/273] fw-addr-lists: two characters for branch Using one character for IPv4 is ok (1 to 9), but IPv6 global unicase (2000::/3) results in just two different characters (2 and 3). So let's use first two characters... --- fw-addr-lists.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index a97f7ed..9ad5b3a 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -100,7 +100,7 @@ :set Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr")); } :do { - :local Branch [ :pick $Address 0 1 ]; + :local Branch [ :pick $Address 0 2 ]; :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={ :if ($Address ~ "/32\$") do={ :set Address [ :pick $Address 0 ([ :len $Address ] - 3) ]; @@ -127,7 +127,7 @@ :foreach Entry in=[ /ip/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ip/firewall/address-list/get $Entry address ]; - :local Branch [ :pick $Address 0 1 ]; + :local Branch [ :pick $Address 0 2 ]; :local TimeOut ($IPv4Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ @@ -148,7 +148,7 @@ :foreach Entry in=[ /ipv6/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ipv6/firewall/address-list/get $Entry address ]; - :local Branch [ :pick $Address 0 1 ]; + :local Branch [ :pick $Address 0 2 ]; :local TimeOut ($IPv6Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ From f0e6cbcfe1a0be05f30d37cd495d4dbea0888f07 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 8 Mar 2025 10:09:51 +0100 Subject: [PATCH 266/273] fw-addr-lists: get branch from calculated checksum The addresses were spread very uneven before. Let's calculate a checksum, and take the first two characters of that. The addresses are now spread evenly on 256 branches (0x00 to 0xff). --- fw-addr-lists.rsc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 9ad5b3a..f0940fe 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -37,6 +37,11 @@ } } + :local GetBranch do={ + :global EitherOr; + :return [ :pick [ :convert transform=md5 to=hex [ :pick $1 0 [ $EitherOr [ :find $1 "/" ] [ :len $1 ] ] ] ] 0 2 ]; + } + :if ([ $ScriptLock $ScriptName ] = false) do={ :set ExitOK true; :error false; @@ -100,7 +105,7 @@ :set Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr")); } :do { - :local Branch [ :pick $Address 0 2 ]; + :local Branch [ $GetBranch $Address ]; :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={ :if ($Address ~ "/32\$") do={ :set Address [ :pick $Address 0 ([ :len $Address ] - 3) ]; @@ -127,7 +132,7 @@ :foreach Entry in=[ /ip/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ip/firewall/address-list/get $Entry address ]; - :local Branch [ :pick $Address 0 2 ]; + :local Branch [ $GetBranch $Address ]; :local TimeOut ($IPv4Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv4 address in list '" . $FwListName . \ @@ -148,7 +153,7 @@ :foreach Entry in=[ /ipv6/firewall/address-list/find where \ list=$FwListName comment=$ListComment ] do={ :local Address [ /ipv6/firewall/address-list/get $Entry address ]; - :local Branch [ :pick $Address 0 2 ]; + :local Branch [ $GetBranch $Address ]; :local TimeOut ($IPv6Addresses->$Branch->$Address); :if ([ :typeof $TimeOut ] = "time") do={ $LogPrintVerbose debug $ScriptName ("Renewing IPv6 address in list '" . $FwListName . \ From eb59dd21caf8026748eada3aee137b8e3b6590b7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Mar 2025 17:33:51 +0100 Subject: [PATCH 267/273] check-routeros-update: check perpetual license... ... as these have to be renewed and can expire. --- check-routeros-update.rsc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 361be34..8d200d2 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -66,6 +66,27 @@ :error "A reboot for update is already scheduled."; } + :local License [ /system/license/get ]; + :if ([ :typeof ($License->"deadline-at") ] = "str") do={ + :if ([ :len ($License->"next-renewal-at") ] = 0 && ($License->"limited-upgrades") = true) do={ + $LogPrint warning $ScriptName ("Your license expired on " . ($License->"deadline-at") . "!"); + $SendNotification2 ({ origin=$ScriptName; \ + subject=([ $SymbolForNotification "warning-sign" ] . "License expired!"); \ + message=("Your license expired on " . ($License->"deadline-at") . \ + ", can no longer update RouterOS on " . $Identity . "...") }); + :set ExitOK true; + :error false; + } + + :if ([ :totime ($License->"next-renewal-at") ] + 1w < [ :timestamp ]) do={ + $LogPrint warning $ScriptName ("Your license will expire on " . ($License->"deadline-at") . "!"); + $SendNotification2 ({ origin=$ScriptName; \ + subject=([ $SymbolForNotification "warning-sign" ] . "License about to expire!"); \ + message=("Your license failed to renew and is about to expire on " . \ + ($License->"deadline-at") . " on " . $Identity . "...") }); + } + } + $LogPrint debug $ScriptName ("Checking for updates..."); /system/package/update/check-for-updates without-paging as-value; :local Update [ /system/package/update/get ]; From 788400c4586b6a2e61c6e36acd10ab5d20da00c9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Mar 2025 16:29:06 +0100 Subject: [PATCH 268/273] fw-addr-lists: raw.githubusercontent.com requires 'USERTrust RSA Certification Authority' now --- certs/Makefile | 2 +- .../USERTrust-RSA-Certification-Authority.pem | 41 +++++++++++++++++++ global-config.rsc | 2 +- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 certs/USERTrust-RSA-Certification-Authority.pem diff --git a/certs/Makefile b/certs/Makefile index 4e252b4..3ccad6e 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -15,7 +15,7 @@ DOMAINS_DUAL = \ git.eworm.de/ISRG-Root-X2 \ lists.blocklist.de/Certum-Trusted-Network-CA \ matrix.org/GTS-Root-R4 \ - raw.githubusercontent.com/DigiCert-Global-Root-G2 \ + raw.githubusercontent.com/USERTrust-RSA-Certification-Authority \ rsc.eworm.de/ISRG-Root-X2 \ upgrade.mikrotik.com/ISRG-Root-X1 DOMAINS_IPV4 = \ diff --git a/certs/USERTrust-RSA-Certification-Authority.pem b/certs/USERTrust-RSA-Certification-Authority.pem new file mode 100644 index 0000000..0fbeef6 --- /dev/null +++ b/certs/USERTrust-RSA-Certification-Authority.pem @@ -0,0 +1,41 @@ +# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Label: "USERTrust RSA Certification Authority" +# Serial: 2645093764781058787591871645665788717 +# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5 +# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e +# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2 +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB +iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl +cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV +BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw +MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV +BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B +3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY +tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/ +Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2 +VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT +79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6 +c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT +Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l +c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee +UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE +Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd +BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF +Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO +VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3 +ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs +8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR +iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze +Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ +XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/ +qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB +VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB +L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG +jjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- diff --git a/global-config.rsc b/global-config.rsc index 2524ded..fa32b16 100644 --- a/global-config.rsc +++ b/global-config.rsc @@ -103,7 +103,7 @@ # cert="ISRG Root X2" }; { url="https://raw.githubusercontent.com/stamparm/ipsum/refs/heads/master/levels/4.txt"; # # higher level (decrease the numerical value) for more addresses, and vice versa - cert="DigiCert Global Root G2" }; + cert="USERTrust RSA Certification Authority" }; { url="https://www.dshield.org/block.txt"; cidr="/24"; cert="ISRG Root X1" }; { url="https://lists.blocklist.de/lists/strongips.txt"; From 97b99316b2f96fa9c5d2f539e31aa308e86c99b4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Mar 2025 10:31:11 +0100 Subject: [PATCH 269/273] netwatch-notify: increase timeout... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as a timeout of one second expires immediately. 🤨 --- netwatch-notify.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index 8b05c5e..9a4c9d9 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -61,12 +61,12 @@ :global GetRandom20CharAlNum; :local FwAddrList ($ScriptName . "-" . [ $GetRandom20CharAlNum ]); - /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s; + /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=2s; :delay 20ms; :if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ :return true; } - /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=1s; + /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=2s; :delay 20ms; :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ :return true; From 155542668719f9feaac45fdb786b2e5fc5fd1e71 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Mar 2025 11:18:18 +0100 Subject: [PATCH 270/273] netwatch-notify: increase the timeout even more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This interacts with the number of addresses in the address-list. Having a lot of addresses there (for exemple from script 'fw-addr-lists' 😜) makes the 'find' take longer. We have to make sure that 'find' succeeds before the address times out. As this does not hurt... Let's just bump to 10 seconds to be safe. --- netwatch-notify.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index 9a4c9d9..2a5050c 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -61,12 +61,12 @@ :global GetRandom20CharAlNum; :local FwAddrList ($ScriptName . "-" . [ $GetRandom20CharAlNum ]); - /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=2s; + /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; :delay 20ms; :if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ :return true; } - /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=2s; + /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; :delay 20ms; :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ :return true; From b63e0fcb2fc282ac69cbef74b35bd40e8df5a464 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Mar 2025 11:26:22 +0100 Subject: [PATCH 271/273] netwatch-notify: check matching address type only --- netwatch-notify.rsc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index 2a5050c..0b8a8dc 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -61,15 +61,19 @@ :global GetRandom20CharAlNum; :local FwAddrList ($ScriptName . "-" . [ $GetRandom20CharAlNum ]); - /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; - :delay 20ms; - :if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ - :return true; + :if ([ :typeof [ :toip $Expected ] ] = "ip") do={ + /ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; + :delay 20ms; + :if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ + :return true; + } } - /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; - :delay 20ms; - :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ - :return true; + :if ([ :typeof [ :toip6 $Expected ] ] = "ip6") do={ + /ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s; + :delay 20ms; + :if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={ + :return true; + } } :return false; From 20bf609c44c2b4111bb387b36b955b8c3243fbf1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Mar 2025 10:51:39 +0100 Subject: [PATCH 272/273] check-routeros-update: fix condition for license check Turns out that `next-renewal-at` is moved forward when renewal failed, so it never matches the criteria. Just start complaining three weeks before deadline. --- check-routeros-update.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc index 8d200d2..78161e4 100644 --- a/check-routeros-update.rsc +++ b/check-routeros-update.rsc @@ -78,7 +78,7 @@ :error false; } - :if ([ :totime ($License->"next-renewal-at") ] + 1w < [ :timestamp ]) do={ + :if ([ :totime ($License->"deadline-at") ] - 3w < [ :timestamp ]) do={ $LogPrint warning $ScriptName ("Your license will expire on " . ($License->"deadline-at") . "!"); $SendNotification2 ({ origin=$ScriptName; \ subject=([ $SymbolForNotification "warning-sign" ] . "License about to expire!"); \ From ce39b79f69f978a8de521643b07b9c19de02b06f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Mar 2025 11:50:38 +0100 Subject: [PATCH 273/273] capsman-download-packages: fix parameter for $RmFile The function can not handle ids, we have to pass a name instead. --- capsman-download-packages.capsman.rsc | 2 +- capsman-download-packages.template.rsc | 2 +- capsman-download-packages.wifi.rsc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index 4387cb1..25c43f5 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -62,7 +62,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - $RmFile $Package; + $RmFile ($File->"name"); } } diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 744494e..b269838 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -64,7 +64,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - $RmFile $Package; + $RmFile ($File->"name"); } } diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index a0c5e12..901bb0a 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -62,7 +62,7 @@ :if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \ ($File->"package-architecture") $PackagePath ] = true) do={ :set Updated true; - $RmFile $Package; + $RmFile ($File->"name"); } }