1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

25 lines
631 B
Plaintext
Raw Normal View History

#!rsc
2018-07-05 15:29:26 +02:00
# RouterOS script: lease-script
# Copyright (c) 2013-2018 Christian Hesse <mail@eworm.de>
#
# run scripts on DHCP lease
# ( / ip dhcp-server set lease-script=lease-script [ find ] )
2018-10-09 13:08:28 +02:00
:local scripts {
"dhcp-to-dns";
"collect-wireless-mac.local";
"dhcp-lease-comment.local";
"collect-wireless-mac.capsman";
"dhcp-lease-comment.capsman"
}
2018-07-05 15:29:26 +02:00
# delay a second to give time to update the lease table
:delay 1s;
:foreach script in=$scripts do={
2018-11-09 21:28:35 +01:00
:if ([ / system script print count-only where name=$script ] > 0) do={
2018-07-05 15:29:26 +02:00
:log debug ("Running script from lease-script: " . $script);
/ system script run $script;
}
}