Commit graph

462 commits

Author SHA1 Message Date
Christian Hesse
a832fd04ef rename scripts and add file extension ".rsc"
No functional change for the user... The migration is done
automatically.
2023-03-07 22:26:01 +01:00
Christian Hesse
b0595e53a5 global-functions: $MkDir: drop the compatibility workaround
If you are still running RouterOS 7.6 or older add this in your
global-config-overlay:

    :global ScriptUpdatesUrlSuffix "\?h=routeros-7.7~1";

... and remeber to revert that change once updated.
2023-02-26 22:27:14 +01:00
Christian Hesse
f5d872a990 global-functions: $PrettyPrint: use $Unix2Dos 2023-02-13 10:36:56 +01:00
Christian Hesse
d54c46ab98 global-functions: introduce $Dos2Unix 2023-02-13 10:36:56 +01:00
Christian Hesse
7d3c4738d0 global-functions: introduce $Unix2Dos 2023-02-13 10:35:27 +01:00
Christian Hesse
62707dc549 ipv6-update: support host addresses in address-list 2023-02-10 11:36:12 +01:00
Christian Hesse
d63db7ea95 global-functions: $ScriptInstallUpdate: use complete property name 2023-02-07 21:20:49 +01:00
Christian Hesse
ba730708f5 notify about backup for global-config-overlay 2023-02-07 21:19:57 +01:00
Christian Hesse
978c03131a global-functions: $WaitForFile: use delay instead of iterations 2023-02-02 11:20:14 +01:00
Christian Hesse
63de875129 daily-psk: make qr-code url configurable 2023-01-31 17:27:15 +01:00
Christian Hesse
cbc547332e check-routeros-update: drop check for cap
This becomes complicated with legacy wireless and wifiwave2 package, old
and new CAPsMAN. Let's just drop the check.
2023-01-31 17:27:15 +01:00
Christian Hesse
819c7294c6 introduce telegram-chat
Druvis from Mikrotik produced a video "MikroTik Telegram bot - Chat with
your Router?". He shows his script to chat with a Router via Telegram
bot to send it commands: https://youtu.be/KLX6j3sLRIE

This script is kind of limited and has several issues... 🥴

Let's make it robust, usable, multi-device capable and just fun! 😁

(Sadly Mikrotik has a policy to not allow links in Youtube comments.
Thus my comment with several hints was removed immediately. If anybody
is in contact with Druvis... Please tell him about this script!)
2023-01-31 17:26:51 +01:00
Christian Hesse
f666d2f8ff global-functions: $WaitForFile: allow to give iterations...
... to increase timeout. Every iteration is about 100ms.
2023-01-31 15:18:17 +01:00
Christian Hesse
b0d3e3d5f4 global-functions: $LogPrintExit2: always print the message...
... even on error. Not sure why and when this broke.
2023-01-26 21:04:59 +01:00
Christian Hesse
555d0e8bfc check-certificates: make the warning time configurable 2023-01-23 17:46:03 +01:00
Christian Hesse
f9839647d4 global-functions: $MkDir: catch error on creating tmpfs 2023-01-23 16:21:30 +01:00
Christian Hesse
c8dcd92e6b global-functions: $MkDir: create with reasonable tmpfs-max-size
Giving no tmpfs-max-size breaks with RouterOS 7.8beta2, where a size
limit is enforced.
2023-01-23 16:21:02 +01:00
Christian Hesse
e6c256cd4b check-health: notify about new features 2023-01-20 23:20:53 +01:00
Christian Hesse
6780e1a24c check-health: monitor free RAM
---- ✂️ ----
🗃️📉️ Health warning: free RAM

The available free RAM on MikroTik is at 18% (47MiB)!
---- ✂️ ----
🗃️📈️ Health recovery: free RAM

The available free RAM on MikroTik increased to 65% (168MiB).
---- ✂️ ----
2023-01-20 23:20:53 +01:00
Christian Hesse
75bd14267e check-health: monitor CPU load
---- ✂️ ----
🧮📈️ Health warning: CPU load

The average CPU load on MikroTik is at 76%!
---- ✂️ ----
🧮📉️ Health recovery: CPU load

The average CPU load on MikroTik decreased to 64%.
---- ✂️ ----
2023-01-20 23:13:27 +01:00
Christian Hesse
2694f8d2b1 global-functions: $RequiredRouterOS: check for valid version string 2023-01-20 11:26:53 +01:00
Christian Hesse
9033e16921 global-functions: use new functionality for version check 2023-01-20 11:26:53 +01:00
Christian Hesse
de9dde1b14 global-functions: $ScriptInstallUpdate: add a version check for scripts
New RouterOS releases bring new features, and thus new syntax.
Installing a new script on old RouterOS results in syntax errors. We
want to give clear warning messages, so by adding an extra comment into
the script...

    # requires RouterOS, version=7.8beta3

... installing on unsupported RouterOS version is mitigated.
2023-01-20 11:26:53 +01:00
Christian Hesse
b834517baa global-functions: implement $Grep...
... that returns the first line that matches a pattern.
2023-01-20 11:26:53 +01:00
Christian Hesse
23e5c01a42 global-functions: $MkDir: no early continue for dir "tmpfs"...
... as we want a RAM disk.
2023-01-12 23:43:38 +01:00
Christian Hesse
f67dc0218b global-functions: $ScriptInstallUpdate: handle config version decrease...
... and log a warning.
2023-01-12 15:40:05 +01:00
Christian Hesse
47a657d25c mod/notification-*: support extra text (or emojis 🚀) in notification tags 2023-01-12 15:40:05 +01:00
Christian Hesse
a953a8fa59 mod/notification-email: move $QuotedPrintable (from global-functions)
This is used for e-mail only...
2023-01-11 12:28:31 +01:00
Anatoly Bubenkov
ea09a18d3f sms-forward: support hooks 2023-01-10 08:58:33 +01:00
Christian Hesse
2f774f723d update copyright for 2023 2023-01-02 23:49:26 +01:00
Christian Hesse
16bfe4de7e global-functions: $MkDir: create a tmpfs (RAM disk)...
... if the path starts with "tmpfs/". This helps to mitigate flash wear.
2022-12-13 21:50:32 +01:00
Christian Hesse
1579330864 global-functions: $MkDir: create directories recursively 2022-12-13 21:25:07 +01:00
Christian Hesse
58f769ac00 global-functions: $MkDir: rename internal variable 2022-12-13 10:37:56 +01:00
Christian Hesse
446d5c89fc global-functions: $MkDir: fail if non-directory path exists 2022-12-13 10:31:41 +01:00
Christian Hesse
9c42263988 global-functions: check RouterOS version before loading modules 2022-12-12 15:16:36 +01:00
Christian Hesse
7f7c3a7a70 global-functions: $SymbolByUnicodeName: append variation selector-16...
... to specify that the preceding character should be displayed with emoji
presentation.

https://unicode-table.com/en/FE0F/
2022-12-06 16:41:14 +01:00
Christian Hesse
8854d03ea2 global-functions: introduce $IsMacLocallyAdministered...
... and use it in $GetMacVendor.
2022-11-29 17:07:40 +01:00
Christian Hesse
ad85f22540 global-functions: $IsTimeSync: no cloud on x86 2022-11-22 22:24:59 +01:00
Christian Hesse
ef7360453f global-functions: $IsTimeSync: no cloud with CHR free license 2022-11-22 22:23:51 +01:00
Christian Hesse
c2a29da9f2 global-functions: $ScriptLock: use shorter random string
... but with all characters from alphabet with $GetRandom20CharAlNum.
2022-11-22 19:05:29 +01:00
Christian Hesse
3c4595e82b global-functions: $MkDir: use shorter random string
... but with all characters from alphabet with $GetRandom20CharAlNum.
2022-11-22 19:05:02 +01:00
Christian Hesse
10182949ea global-functions: $ScriptInstallUpdate: disable notification only...
... if requested, but keep output and logs.
2022-09-28 09:17:32 +02:00
Christian Hesse
b18ca62dbd global-functions: $ScriptInstallUpdate: drop dead code... 2022-09-28 09:17:12 +02:00
Christian Hesse
5120aa096f global-functions: $ScriptInstallUpdate: drop code for permission workaround
This is no longer used as 'netwatch-syslog' is gone.
2022-09-25 22:18:44 +02:00
Christian Hesse
bfe2cbf575 drop 'netwatch-syslog'
To filter in firewall you should use something like this:

/ip/firewall/filter/add action=reject chain=output out-interface-list=WAN port=514 protocol=udp reject-with=icmp-admin-prohibited;
/ip/firewall/filter/add action=reject chain=forward out-interface-list=WAN port=514 protocol=udp reject-with=icmp-admin-prohibited;
2022-09-25 22:18:44 +02:00
Christian Hesse
eccc187014 introduce 'mod/notification-email', split off from global-functions 2022-09-25 22:10:05 +02:00
Christian Hesse
562c565fcf global-functions: $FlushEmailQueue: do not flush if sending 2022-09-25 18:44:14 +02:00
Christian Hesse
84b5e77860 global-functions: $GetMacVendor: detect locally administered addresses
https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local_(U/L_bit)
2022-09-20 09:30:33 +02:00
Christian Hesse
3f92edb5c1 global-functions: $FlushEmailQueue: use $0 for scheduler name 2022-09-15 22:25:59 +02:00
Christian Hesse
f245751339 global-functions: $FlushEmailQueue: do not flush with resolver issues
Flushing the mail queue with resolver issues can flood the log with
messages like:

e-mail;error Error sending e-mail <=?utf-8?Q?[MikroTik] =F0=9F=92=BE=E2=98=81 Cloud backup?=>: DNS resolve failed

Try to avoid this...
2022-09-15 22:03:19 +02:00