Created
October 24, 2025 13:03
-
-
Save squarooticus/8e68170ad51735193e9a3698a4d9d680 to your computer and use it in GitHub Desktop.
Assign the MAC address as part of dynamic hostname to distinguish them
This file contains hidden or 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
| set hwstr = concat ( | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,1,1))),2), "-", | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,2,1))),2), "-", | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,3,1))),2), "-", | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,4,1))),2), "-", | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,5,1))),2), "-", | |
| suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,6,1))),2) | |
| ); | |
| if not (exists host-name) or not (option host-name ~~ "^[a-z0-9-]+$") { | |
| ddns-hostname = concat("dhcp-" , hwstr); | |
| } elsif option host-name ~~ "^(chromecast|google-)" { | |
| ddns-hostname = concat(option host-name, "-", hwstr); | |
| } | |
| # Can't wait until I have to figure out how to do this with Kea or some other replacement 🙄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment