Commit graph

253 commits

Author SHA1 Message Date
Christian Hesse
8353a8547f global-functions: $DownloadPackage: use $FileExists ...
... to work around restrictions in new file handling.
2025-06-04 22:30:33 +02:00
Christian Hesse
cb984a5e52 global-functions: introduce $FileExists 2025-06-04 22:28:25 +02:00
Christian Hesse
0e00a228d6 global-functions: $WaitForFile: use :retry for simplification, ...
... and to work around restrictions in new file handling.
2025-06-04 22:28:20 +02:00
Christian Hesse
e08bb2192d global-functions: $WaitForFile: drop the workaround
This was fixed in RouterOS 7.18rc1, so should be ok to remove now.
2025-06-04 22:28:20 +02:00
Christian Hesse
fb8e616846 global-functions: $RmFile: use $FileGet ...
... to work around restrictions in new file handling.
2025-06-04 22:28:17 +02:00
Christian Hesse
d993495e44 global-functions: $RmDir: use $FileGet ...
... to work around restrictions in new file handling.
2025-06-04 22:28:14 +02:00
Christian Hesse
1e4f168735 global-functions: $MkDir: use $FileGet ...
... to work around restrictions in new file handling.
2025-06-04 22:28:11 +02:00
Christian Hesse
b70e6e7984 global-functions: introduce $FileGet 2025-06-03 12:29:42 +02:00
Christian Hesse
bf684a7197 global-functions: $CertificateAvailable: try to use builtin certificates
The builtin certificates were introduced with RouterOS 7.19, so requires
this hacky :parse workaround.
2025-05-28 15:08:26 +02:00
Christian Hesse
4bd7d44cd2 global-functions: $ScriptInstallUpdate: fix syntax error 2025-05-23 11:16:40 +02:00
Christian Hesse
86ad41f6b6 fix the trust state for certificates
RouterOS 7.19 is suffering an issue with certificate store, where the
trust state is not available correctly. This effects certificates
imported a long time ago, with RouterOS 7.4 or older.

Fixing trust state for all certificates by re-setting the trust state...

(Reported as SUP-188791...)
2025-05-23 10:51:04 +02:00
Christian Hesse
5c599beae1 global-functions: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
8b1b73c936 global-functions: $ValidateSyntax: add debug output 2025-05-21 22:12:25 +02:00
Christian Hesse
f5c4378676 global-functions: $ValidateSyntax: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
12926b7c42 global-functions: $ScriptInstallUpdate: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
2317013121 global-functions: $RmFile: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
86a8919ed2 global-functions: $RmDir: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
09f9826760 global-functions: $MkDir: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
7a1fef78a2 global-functions: $GetMacVendor: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
a6b36dde7b global-functions: $FetchHuge: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
5b89f3e425 global-functions: $DownloadPackage: :do ... on-error=... -> :onerror ... do=... 2025-05-21 22:12:25 +02:00
Christian Hesse
6691e2e765 global-functions: $DownloadPackage: reverse failure logic...
... and do not retry.
2025-05-21 21:51:16 +02:00
Christian Hesse
f095b581e7 global-functions: $ScriptInstallUpdate: set config and functions not ready...
... before reload. This should fix some corner cases where scripts ran
with broken configuration or functions.

Also do reload both - configuration and functions - to simplify the
function.
2025-05-12 12:09:24 +02:00
Christian Hesse
41bf9677db global-functions: use :onerror for outer block 2025-05-06 09:50:20 +02:00
Christian Hesse
90f61d3d75 global-functions: $ExitError: support to pass in error message 2025-05-06 09:43:57 +02:00
Leonardo David Monteiro
0717ebfbd5 introduce mod/notification-gotify...
... for sending notifications via Gotify (https://gotify.net).

Closes: https://github.com/eworm-de/routeros-scripts/pull/92

Co-authored-by: Christian Hesse <mail@eworm.de>
2025-05-03 22:11:22 +02:00
Christian Hesse
29bcd191ee global-functions: $ScriptInstallUpdate: support downloading certificate...
... for individual scripts. Just add it in comment with
"certificate=...". This also works on installtion:

$ScriptInstallUpdate new-script "base-url=..., certificate=...";

Closes: https://github.com/eworm-de/routeros-scripts/pull/97
2025-04-17 10:48:45 +02:00
Christian Hesse
d4b5e1f5e7 global-functions: $CertificateNameByCN: warn with no match 2025-04-10 11:08:43 +02:00
Christian Hesse
c823ff87ed global-functions: $CertificateNameByCN: return false without match...
... and return true on success.
2025-04-08 16:09:53 +02:00
Christian Hesse
44fa91f5c4 global-functions: $CertificateNameByCN: pick the first match only 2025-04-08 16:09:53 +02:00
Christian Hesse
e36613608c global-functions: $CertificateNameByCN: support matching by fingerprint and name 2025-04-08 16:09:53 +02:00
Christian Hesse
019e10e190 global-functions: $CertificateDownload: no infinite loop
We can not call $CertificateAvailable here, as that will most likely
cause an infinite loop. After all that's the certificate mkcert.org is
using. And it *is* available in this repository.
2025-04-08 16:09:53 +02:00
Christian Hesse
314ba5796d global-functions: $ScriptLock: increase interval with wait time
Inspired by: https://github.com/eworm-de/routeros-scripts/issues/95#issuecomment-2773513467
2025-04-08 16:09:53 +02:00
Ilya Kulakov
27987a0d7c global-functions: $ScriptLock: fix second parameter
This broke with 1e8918fdaa5a30393e2004d1f5e4dff458936b67...

Fixes: https://github.com/eworm-de/routeros-scripts/issues/95
2025-04-08 09:11:45 +02:00
Christian Hesse
3c30276e23 check-routeros-update: split off check-perpetual-license...
... and also add documentation, screenshot, etc.
2025-04-01 17:39:50 +02:00
Christian Hesse
7be26a0712 DEBUG: add info on $LogPrintVerbose 2025-03-06 15:59:44 +01:00
Christian Hesse
e341e1c30c 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;
2025-03-06 15:59:11 +01:00
Christian Hesse
1b46a5fd9b global-functions: $ScriptInstallUpdate: checksum only for same source
So ignore if script is fetched from different base or with different
suffix.
2025-03-06 10:43:13 +01:00
Christian Hesse
b13360e4b8 global-functions: $ScriptInstallUpdate: simplify check
This one should suffice...
2025-03-06 10:42:52 +01:00
Christian Hesse
c9de6d8579 global-functions: $ScriptInstallUpdate: put checksum into variable 2025-03-06 10:42:27 +01:00
Christian Hesse
10374afc18 global-functions: $ScriptInstallUpdate: support checksums for CRLF scripts 2025-03-06 10:42:00 +01:00
Christian Hesse
0c1d96f89d global-functions: $ScriptInstallUpdate: get and compare checksums
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. 🎉😁
2025-03-06 10:41:28 +01:00
Christian Hesse
3ccaafd1b3 global-functions: $ScriptInstallUpdate: move code into block 2025-03-05 01:15:22 +01:00
Christian Hesse
53b13b295a mod/notification-telegram: introduce $GetTelegramChatId 2025-02-25 22:37:30 +01:00
Christian Hesse
c33eb41c9c global-functions: $DeviceInfo: add license level, re-order 2025-02-25 17:55:26 +01:00
Christian Hesse
e5de9de391 notify on support for Telegram group topics 2025-02-25 17:55:26 +01:00
Christian Hesse
58da92e36a global-functions: $WaitForFile: drop the warning on file handling breakage...
... but keep the workaround for now - just to be sure.
2025-02-19 22:21:03 +01:00
Christian Hesse
2c92c78b46 global-functions: $ScriptInstallUpdate: also show commit info 2025-02-17 13:55:44 +01:00
Christian Hesse
75633872aa global-functions: $DeviceInfo: also show commit info 2025-02-17 13:55:36 +01:00
Christian Hesse
dafcc1a0cb global-functions: $RmFile: fix type safeguard
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
2025-02-13 17:58:48 +01:00