Commit graph

1062 commits

Author SHA1 Message Date
Christian Hesse 73dfb0c8ee check-health: use $ScriptLock 2021-08-27 11:21:56 +02:00
Christian Hesse 7afce17f70 netwatch-notify: use $ScriptLock 2021-08-27 11:20:57 +02:00
Christian Hesse d556e97a46 dhcp-to-dns: check for existence of address
Chances are that $LeaseVal is an array with just an id - no idea why this
happens. So do not check for array but existence of address.
2021-08-26 11:12:39 +02:00
Christian Hesse 772e66b622 global-functions.d/notification-telegram: for syntax for ROS 7.x
Strings with escape sequence have to be enclosed in parentheses. Looks
like RouterOS 7.x is stricter here...
2021-08-25 00:35:08 +02:00
Christian Hesse d4896f2585 update list of contributors 2021-08-16 12:39:53 +02:00
Christian Hesse 4269bc9548 global-functions: $ScriptLock: check for successful removal of ticket
The script is already locked, so there is no second script to remove a
ticket at the same time. However a new script can add a new ticket and
overwrite the removal... Thus check for successful removal anyway.
2021-07-25 23:19:54 +02:00
Christian Hesse 8e2c783068 lease-script: drop differentiation of assign / deassign...
... not that we have early locking.
2021-07-15 12:47:05 +02:00
Christian Hesse 9509371690 lease-script: use $ScriptLock
There were still ways to produce errors from lease scripts...
Let's lock earlier, this should fix it.
2021-07-15 11:45:35 +02:00
Christian Hesse 698c795eee update list of contributors 2021-07-15 11:25:46 +02:00
Ben Harris 9fba3dd8df global-functions: $ScriptLock: fix off-by-one check...
... for stale job tickets

Signed-off-by: Christian Hesse <mail@eworm.de>
2021-07-15 10:17:25 +02:00
Christian Hesse 29ececda9b collect-wireless-mac: check for existence of mac address
Chance are that $RegVal is an array with just an id - no idea why this
happens. So do not check for array but existence of mac address.
2021-07-11 22:30:00 +02:00
Christian Hesse 483506b189 global-functions: introduce $ScriptRunOnce 2021-07-10 23:18:04 +02:00
Christian Hesse d1ef710093 global-functions: $ScriptInstallUpdate: add error handling for changelog 2021-07-09 22:04:15 +02:00
Christian Hesse 574c50908b global-functions.d/notification-telegram: subject in bold & underline
This makes the subject visually delimited.
2021-07-09 21:21:30 +02:00
Christian Hesse dc7fc0d385 finally remove old scripts 2021-07-09 12:46:03 +02:00
Christian Hesse b864db1e38 global-functions: $ScriptInstallUpdate: add error handling for migration 2021-07-09 12:46:03 +02:00
Christian Hesse f694e1e54d global-functions: $ScriptInstallUpdate: drop unused variable
This was a left-over from re-run message.
2021-07-09 12:46:03 +02:00
Christian Hesse 81cba72bec global-functions: $ScriptInstallUpdate: drop the migration pattern 2021-07-09 12:46:03 +02:00
Christian Hesse d80a7efb7c doc/netwatch-notify: hint on escaping, with example 2021-07-09 12:46:03 +02:00
Christian Hesse bccb7c3452 netwatch-notify: implement pre-down hook 2021-07-09 12:46:03 +02:00
Christian Hesse 12d34e4a7c collect-wireless-mac: remove 'unknown' from message and comment
This was true, but the mac address is no longer unknown after it was
added to address list in comment.
2021-07-09 10:40:13 +02:00
Christian Hesse 4192d30d7e global-functions: $ScriptLock: drop variable, just return 2021-07-09 10:40:13 +02:00
Christian Hesse a4e548eb80 global-functions: $ScriptLock: make ticket management more reliable 2021-07-08 21:03:31 +02:00
Christian Hesse 6c9f733d96 lease-script: add the order in log 2021-07-08 21:03:31 +02:00
Christian Hesse 6bf8cd5fac lease-script: implement script order
The order may be important: `collect-wireless-mac` can add a dns name
in notification, thus `dhcp-to-dns` should run first.
2021-07-08 21:03:31 +02:00
Christian Hesse 623fd707c4 lease-script: modify the tag 2021-07-08 16:09:03 +02:00
Christian Hesse c5d49b37f3 netwatch-notify: run hook from a function 2021-07-08 13:38:21 +02:00
Christian Hesse 87ce4a86b7 netwatch-notify: add error handling for hooks
We already had syntax validation, but a script with valid synctax can
still fail to run...
2021-07-08 13:02:57 +02:00
Christian Hesse 1eb337d87f doc/lease-script: hint on script installation/execution order 2021-07-07 00:33:36 +02:00
Christian Hesse d7170bf138 doc/lease-script: fix link 2021-07-07 00:33:36 +02:00
Christian Hesse e5674dec24 collect-wireless-mac: use $EitherOr and simplify code 2021-07-07 00:33:34 +02:00
Christian Hesse c982cde0bd collect-wireless-mac: do not fail on missing dns record 2021-07-07 00:32:50 +02:00
Christian Hesse 5083ffd12f collect-wireless-mac: rework, more use of arrays 2021-07-06 21:41:33 +02:00
Christian Hesse 92a97b12ca ospf-to-leds: do not flood but log properly 2021-07-06 21:41:33 +02:00
Christian Hesse fcc0d1551a doc/netwatch-notify: hint on checking specific isp 2021-07-05 15:00:47 +02:00
Michael Gisbers d5edcbd3b6 check-routeros-update: allow update for cap
If CAPsMAN is running on a device with just 16MB flash downloading the
packages is not possible (or at least lost at reboot). So allow a CAP to
update with opt-in.
2021-07-01 22:56:18 +02:00
Christian Hesse 877e95d4be collect-wireless-mac: properly handle vanished device 2021-07-01 22:52:38 +02:00
Christian Hesse 5f357fd242 dhcp-to-dns: fix static lease that lost bound status 2021-07-01 22:52:38 +02:00
Christian Hesse 23daea2354 dhcp-to-dns: properly handle vanished lease 2021-07-01 22:52:38 +02:00
Christian Hesse 9c9fb46e4a lease-script: do not run too many instances of scripts
Every instance of the scripts does all the work. If one script is running
and a second script is waiting we do not have to start a third one.
2021-07-01 22:52:38 +02:00
Christian Hesse 5f2bc87b22 lease-script: drop the delay magic...
... as this should be handled by $ScriptLock in lease scripts now.
2021-07-01 22:52:38 +02:00
Christian Hesse 08b1b72fa9 hotspot-to-wpa-cleanup: lock script (and wait) 2021-07-01 22:52:38 +02:00
Christian Hesse 64b53d2322 dhcp-to-dns: lock script (and wait) 2021-07-01 22:52:38 +02:00
Christian Hesse df43f61018 collect-wireless-mac: wait when locking script 2021-07-01 22:52:38 +02:00
Christian Hesse 3f893a327d Merge branch 'ScriptLock' into next 2021-07-01 22:52:23 +02:00
Christian Hesse aad91d90ea global-functions: $ScriptLock: use hex string for ticket
Does not matter what the ticket looks like, but using hex string it is
not converted to number.
2021-07-01 22:37:03 +02:00
Christian Hesse 0b4c1861cf global-functions: $ScriptLock: use a limit on lock...
... to make sure it does not lock forever.
2021-07-01 22:37:03 +02:00
Christian Hesse 7de3457f44 global-functions: $ScriptLock: allow to wait for lock 2021-06-30 21:28:27 +02:00
Christian Hesse 5d30886e59 global-functions: $ScriptLock: rework with tickets
Getting the order right is not easy... We use a global variable to store
"tickets" in an array. Based on that scripts know their order.
2021-06-30 21:28:27 +02:00
Christian Hesse b2d0ed1240 global-functions: $ScriptLock: check if script is running 2021-06-30 21:18:38 +02:00