Code: Select all
returns $value without invalid characters for a Hostname
if $allowMultipleLabels is not nothing, then it also allows dots between labels
Code: Select all
/system script run stripInvalidHostNameCharactersFromString
:put [$stripInvalidHostNameCharactersFromString value=("a host name")]
ahostname
:put [$stripInvalidHostNameCharactersFromString value=("a host name.domain name" ) allowMultipleLabels="yes"]
ahostname.domainname