Created
May 2, 2018 08:46
-
-
Save jmcarbo/3ca7e22179efcbedd1618e8d2cbaad86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ip dhcp-server lease { | |
:foreach i in=[find (dynamic && status="bound" && server="rang172-20-4")] do={ | |
:local activeAddress [get $i active-address] | |
:local activeMacAddress [get $i active-mac-address] | |
:local hostname "" | |
:local hostname [get $i host-name] | |
:if ( [:len $hostname] > 0) do={ :put "OK $[:len $hostname] *$hostname*"; [/ip dhcp-server lease make-static $i]; } | |
:put ($outputContent . "\n" . $activeAddress . "," . $activeMacAddress . "," . $hostname) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment