aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-lease-comment.local
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-lease-comment.local')
-rw-r--r--dhcp-lease-comment.local20
1 files changed, 10 insertions, 10 deletions
diff --git a/dhcp-lease-comment.local b/dhcp-lease-comment.local
index 82cc9a9..98c11cc 100644
--- a/dhcp-lease-comment.local
+++ b/dhcp-lease-comment.local
@@ -6,16 +6,16 @@
#
# !! Do not edit this file, it is generated from template!
-:foreach lease in=[ / ip dhcp-server lease find where dynamic=yes ] do={
- :local macaddress [ / ip dhcp-server lease get $lease mac-address ];
- :local oldcomment [ / ip dhcp-server lease get $lease comment ];
- :local newcomment;
- :local accesslst [ :pick [ / interface wireless access-list find where mac-address=$macaddress ] 0 ];
- :if ( [ :len $accesslst ] > 0 ) do={
- :set newcomment [ / interface wireless access-list get $accesslst comment ];
+:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes ] do={
+ :local MacAddress [ / ip dhcp-server lease get $Lease mac-address ];
+ :local OldComment [ / ip dhcp-server lease get $Lease comment ];
+ :local NewComment;
+ :local AccessList [ :pick [ / interface wireless access-list find where mac-address=$MacAddress ] 0 ];
+ :if ([ :len $AccessList ] > 0) do={
+ :set NewComment [ / interface wireless access-list get $AccessList comment ];
}
- :if ([ :len $newcomment ] != 0 && $oldcomment != $newcomment) do={
- :log info ("Updating comment for DHCP lease " . $macaddress . ": " . $newcomment);
- / ip dhcp-server lease set comment=$newcomment $lease;
+ :if ([ :len $NewComment ] != 0 && $OldComment != $NewComment) do={
+ :log info ("Updating comment for DHCP lease " . $MacAddress . ": " . $NewComment);
+ / ip dhcp-server lease set comment=$NewComment $Lease;
}
}