mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
dhcp-lease-comment: use $LogPrintExit
This commit is contained in:
parent
3127800496
commit
be5b6e0687
3 changed files with 9 additions and 3 deletions
|
@ -6,6 +6,8 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
||||||
:local NewComment;
|
:local NewComment;
|
||||||
|
@ -14,7 +16,7 @@
|
||||||
:set NewComment [ / caps-man access-list get $AccessList comment ];
|
:set NewComment [ / caps-man access-list get $AccessList comment ];
|
||||||
}
|
}
|
||||||
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
||||||
:log info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment);
|
$LogPrintExit info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment) false;
|
||||||
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
||||||
:local NewComment;
|
:local NewComment;
|
||||||
|
@ -14,7 +16,7 @@
|
||||||
:set NewComment [ / interface wireless access-list get $AccessList comment ];
|
:set NewComment [ / interface wireless access-list get $AccessList comment ];
|
||||||
}
|
}
|
||||||
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
||||||
:log info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment);
|
$LogPrintExit info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment) false;
|
||||||
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
# !! This is just a template! Replace '%PATH%' with 'caps-man'
|
||||||
# !! or 'interface wireless'!
|
# !! or 'interface wireless'!
|
||||||
|
|
||||||
|
:global LogPrintExit;
|
||||||
|
|
||||||
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
:foreach Lease in=[ / ip dhcp-server lease find where dynamic=yes status=bound ] do={
|
||||||
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
:local LeaseVal [ / ip dhcp-server lease get $Lease ];
|
||||||
:local NewComment;
|
:local NewComment;
|
||||||
|
@ -15,7 +17,7 @@
|
||||||
:set NewComment [ / %PATH% access-list get $AccessList comment ];
|
:set NewComment [ / %PATH% access-list get $AccessList comment ];
|
||||||
}
|
}
|
||||||
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
:if ([ :len $NewComment ] != 0 && $LeaseVal->"comment" != $NewComment) do={
|
||||||
:log info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment);
|
$LogPrintExit info ("Updating comment for DHCP lease " . $LeaseVal->"mac-address" . ": " . $NewComment) false;
|
||||||
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
/ ip dhcp-server lease set comment=$NewComment $Lease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue