Commit graph

498 commits

Author SHA1 Message Date
Christian Hesse
98585afe1c add script 'global-wait'
Run this in schedulers that fire on startup without interval. Schedulers
should look something like this:

/ system scheduler {
  add name=global-scripts on-event="/ system script { run global-config; run global-config-overlay; run global-functions; }" start-time=startup;
  add name=bridge-port-to-default on-event="/ system script { run global-wait; run bridge-port-to-default; }" start-time=startup;
}
2020-03-12 08:40:29 +01:00
Christian Hesse
63ed093340 check-health: add encoded degree sign 2020-03-09 16:23:10 +01:00
Christian Hesse
1f8c22b23d hotspot-to-wpa: unbreak options 2020-03-09 13:46:06 +01:00
Christian Hesse
8992b18166 global-functions: $DeviceInfo: more indention 2020-03-09 09:29:36 +01:00
Christian Hesse
8020955b3b script-updates: also consider scripts with empty source for update 2020-03-05 20:09:36 +01:00
Christian Hesse
f3e2fb654b netwatch-notify: add logging 2020-03-05 12:47:42 +01:00
Christian Hesse
9aed03693c netwatch-notify: fix handling of array
Looks like handling of more-dimensional arrays is a bit tricky in
RouterOS... Without this *all* values with the same key name are
updated, independent of intermediate name.
2020-03-05 12:42:21 +01:00
Christian Hesse
3d07ebde05 global-functions: $SendEMail: invert condition 2020-03-05 11:00:36 +01:00
Christian Hesse
227151e189 global-functions: $SendTelegram: invert condition 2020-03-05 11:00:36 +01:00
Christian Hesse
34db2e34db global-functions: $SendTelegram: allow to override chatid
This allows to send Telegram messages to different contact or group.
Use something like this:

/system scheduler add name=netwatch-notify interval=1m start-time=startup \
  on-event=":global TelegramChatIdOverride \"-1234\"; / system script run netwatch-notify; :set TelegramChatIdOverride;"
2020-03-05 10:54:48 +01:00
Christian Hesse
71ae8cb75f rotate-ntp: use $LogPrintExit 2020-03-05 09:42:28 +01:00
Christian Hesse
27e2635007 bridge-port-to-default: use $LogPrintExit for debug 2020-03-05 09:24:10 +01:00
Christian Hesse
bf41a8d48a always use severity 'warning', not just 'warn' 2020-03-05 09:18:23 +01:00
Christian Hesse
e104b54bf0 hotspot-to-wpa: use $LogPrintExit and add more logging 2020-03-05 09:17:19 +01:00
Christian Hesse
970641a974 check-routeros-update: use $LogPrintExit 2020-03-05 09:08:57 +01:00
Christian Hesse
08bb73b6fc check-certificates: use $LogPrintExit for debug 2020-03-05 09:01:11 +01:00
Christian Hesse
34255c9050 script-updates: use $LogPrintExit for debug 2020-03-05 08:58:29 +01:00
Christian Hesse
3ec34fa752 dhcp-to-dns: fix value in message 2020-03-05 08:43:56 +01:00
Christian Hesse
554308a399 dhcp-to-dns: use $LogPrintExit 2020-03-05 08:37:12 +01:00
Christian Hesse
be5b6e0687 dhcp-lease-comment: use $LogPrintExit 2020-03-05 08:34:33 +01:00
Christian Hesse
3127800496 daily-psk: use $LogPrintExit 2020-03-05 08:26:05 +01:00
Christian Hesse
1dbd91f76d collect-wireless-mac: use $LogPrintExit 2020-03-05 08:22:47 +01:00
Christian Hesse
f90c59e4fb netwatch-notify: properly initialize default values 2020-03-05 08:15:36 +01:00
Christian Hesse
792eba8465 global-functions: $LogPrintExit: add debugging option 2020-03-05 08:11:17 +01:00
Christian Hesse
478688d534 netwatch-notify: use another level of array 2020-03-04 21:01:21 +01:00
Christian Hesse
e588607efd add script netwatch-notify 2020-03-04 15:56:40 +01:00
Christian Hesse
628ae1bd70 bridge-port-to-default: use $ParseKeyValueStore...
... and unbreak last commit removing delay (69352c90).
This requires a change in configuration syntax. Change this...

    comment="default:br-local, alt:br-guest"

to...

    comment="default=br-local, alt=br-guest"
2020-03-03 13:32:00 +01:00
Christian Hesse
4ccdec602e bridge-port-to-default: use $LogPrintExit 2020-03-03 08:54:18 +01:00
Christian Hesse
001e7eeb39 global-functions: sort alphabetically 2020-02-28 15:26:26 +01:00
Christian Hesse
3db752bc97 global-functions: $ScriptLock: use $LogPrintExit 2020-02-27 13:51:27 +01:00
Christian Hesse
ceaa83b83e global-functions: merge $LogAnd{Error,Put} to $LogPrintExit ...
... and fix logging.

Logging with severity from variable (:log $severity ...) is not
possible, this is considered a syntax error. Also the 'workaround' with
parsing code failed with missing message in log.

The reliable code is a lot longer, so merge the two functions to save a
lot of duplicate code.
2020-02-26 14:19:54 +01:00
Christian Hesse
6036edb506 packages-update: use $LogAndError 2020-02-26 12:58:49 +01:00
Christian Hesse
3cd9b9ead5 check-certificates: use $LogAndPut 2020-02-26 12:55:38 +01:00
Christian Hesse
b70a460f43 check-certificates: use $LogAndError 2020-02-26 12:54:13 +01:00
Christian Hesse
d516b1b249 script-updates: use $LogAndPut 2020-02-26 12:15:07 +01:00
Christian Hesse
312caf3f90 global-functions: introduce $LogAndPut 2020-02-26 12:11:50 +01:00
Christian Hesse
3ebf68a08c global-functions: $LogAndError: add severity 2020-02-26 12:09:19 +01:00
Christian Hesse
6ef764c7d7 hotspot-to-wpa: automatically add missing access-list entry 2020-02-26 11:51:49 +01:00
Christian Hesse
0e6438eaff upload-backup: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
c766d2dfda update-tunnelbroker: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
86ed56e7ad email-backup: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
286d7ced11 ipv6-update: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
801608eeaf check-certificates: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
0326a7222c lease-script: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
7ec411c542 sms-action: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
f1ab717ae5 ppp-on-up: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
1d93bcbc0d check-routeros-update: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
9b9ad20b3d packages-update: use $LogAndError 2020-02-26 11:51:49 +01:00
Christian Hesse
bb9a4e6ecf sms-forward: use $LogAndError 2020-02-26 11:49:11 +01:00
Christian Hesse
556fc2d0d3 global-functions: introduce $LogAndError 2020-02-24 19:53:15 +01:00