Last active
September 13, 2023 09:59
-
-
Save kangarie/833ef83f56a1e7105d15832797124ddf to your computer and use it in GitHub Desktop.
Mikrotik DHCP server script to update queue comment based on host name
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
:local namahost $"lease-hostname" | |
:local status | |
:local pesan | |
:if ($leaseBound = 0) do={ :set status "Logout" } else={ :set status "Login" } | |
:set pesan "$status - $leaseServerName - $leaseActIP - $namahost" | |
:log warning "$pesan" | |
:if ($leaseBound = 0) do={ | |
/queue simple set [find target="$leaseActIP"."/32"] comment="" | |
/queue simple reset-counters [find target="$leaseActIP"."/32"] | |
} else={ | |
/queue simple set [find target="$leaseActIP"."/32"] comment="$namahost" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment