Commit graph

425 commits

Author SHA1 Message Date
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
Christian Hesse
69352c90d5 bridge-port-to-default: drop delay
Now that we expect the scheduler to have a delay and script-updates
warning about it...
2020-02-24 19:47:17 +01:00
Christian Hesse
5316ec6ef5 script-updates: warn on scheduler at startup with no interval 2020-02-24 19:43:35 +01:00
Christian Hesse
125f37615b drop script 'daily-psk-schedule'
We have some useful functions that can replace the functionality. Just
add a schedule like this:

add name=daily-psk-startup on-event=":delay 1s; :global WaitTimeSync; \$WaitTimeSync; / system script run daily-psk.local;" start-time=startup
2020-02-24 13:01:45 +01:00
Christian Hesse
19b80ee063 global-functions: $WaitTimeSync: rotate ntp servers minutely
Signed-off-by: Christian Hesse <mail@eworm.de>
2020-02-24 13:01:45 +01:00
Christian Hesse
5fab77abad global-functions: introduce $WaitTimeSync 2020-02-24 12:55:18 +01:00
Christian Hesse
2a80fd6dbe check-certificates: check for synced time 2020-02-24 11:14:49 +01:00
Christian Hesse
6e8f5f19f6 daily-psk-schedule: use $TimeIsSync 2020-02-24 11:08:11 +01:00
Christian Hesse
77ec3293f0 global-functions: introduce $TimeIsSync 2020-02-24 11:06:17 +01:00
Christian Hesse
4984b4fd51 daily-psk-schedule: use $MailServerIsUp 2020-02-24 10:48:41 +01:00
Christian Hesse
e11ddeaf8c sms-forward: use $MailServerIsUp 2020-02-24 10:48:24 +01:00
Christian Hesse
7d2239f24e global-functions: introduce $MailServerIsUp 2020-02-24 10:48:04 +01:00
Christian Hesse
23fe30c4e1 check-certificates: rename all certificates by their common names 2020-02-06 18:18:56 +01:00
Christian Hesse
e376845b12 global-functions: introduce and use $CertificateNameByCN 2020-02-06 18:18:56 +01:00
Christian Hesse
38b23ddc10 script-updates: prefix variable name with dollar 2020-02-05 17:09:30 +01:00
Christian Hesse
b5f4c2c87e global-config: drop $ScriptUpdatesConfigChangesIgnore
Comment or remove $GlobalConfigVersion in global-config-overlay
to disable change notifications.
2020-02-04 20:19:46 +01:00
Christian Hesse
03af7d6d9c global-functions: $CharacterReplace: do not limit string length
I've tried something like this to update a device:

/ system script set source=[ $CharacterReplace [ get global-config-overlay source ] "GlobalConfigVersion 10" "GlobalConfigVersion 11" ] global-config-overlay;

This broke with global-config-overlay longer than 999 characters. So makes
sure there is no limit for string length.
2020-02-03 21:29:21 +01:00
Christian Hesse
0c705d5311 global-config-overlay: add footer
... to guard against truncation by accident.
2020-02-03 09:29:53 +01:00
Christian Hesse
7f81734006 global-functions: $CertificateAvailable: simplify loop 2020-02-02 15:16:36 +01:00
Christian Hesse
1e72f03e5e README: update instructions to use $ScriptInstallUpdate 2020-01-29 22:14:56 +01:00
Christian Hesse
833e72eac8 script-updates: only handle scripts with magic pattern
This is supposed to prevent overwriting foreign scripts. New scripts are
expected to be installed with function $ScriptInstallUpdate!
2020-01-29 21:44:41 +01:00
Christian Hesse
c500243c97 global-functions: add $ScriptInstallUpdate
Just call without parameters to update scripts:

[admin@MikroTik] > $InstallAndUpdate

Add comma separated list of scripts to install and update:

[admin@MikroTik] > $InstallAndUpdate cloud-backup[,upload-backup][,...]
2020-01-29 21:44:41 +01:00
Christian Hesse
352818ea48 global-functions: $CertificateAvailable: check whole chain
The root certificate is a self-signed certificate. Check for the issue
certificate until we find the self-signed one.
2020-01-29 21:08:10 +01:00
Christian Hesse
801dce05fa global-functions: $CertificateAvailable: warn about crl download to flash
Downloading certificate crls to flash can fill up all available space.
So warn about it!
2020-01-29 09:27:00 +01:00