On Systems with a bond the interface for example is called "ovs_bond0" which breaks the current behaviour of hardcoded interfaces. This PR changes the way adapters are handled by reading out all the interfaces from the system instead of keeping a hardcoded list.
Also this PR removes all invalid characters from the hostname as I had trouble with a host that had an underscore like "host_name". Underscores are not allowed to be in hostnames and bind won't load the zone if that hostname is used.
(See: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames )
gsub(/([^a-zA-Z0-9-]*|^[-]*|[-]*$)/,"",NAME)
Means: Replace every character sequence that is not a alphanumeric or a hyphen OR sequence of hyphens at the begining OR at the end of NAME with an empty string.
Sorry @WolfspiritM I guess I missed this PR. I'll try it out on my DSM 5.1 system before merging it. Maybe in the next few days or so I should have some time.
On Systems with a bond the interface for example is called "ovs_bond0" which breaks the current behaviour of hardcoded interfaces. This PR changes the way adapters are handled by reading out all the interfaces from the system instead of keeping a hardcoded list.
Also this PR removes all invalid characters from the hostname as I had trouble with a host that had an underscore like "host_name". Underscores are not allowed to be in hostnames and bind won't load the zone if that hostname is used. (See: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames )
Means: Replace every character sequence that is not a alphanumeric or a hyphen OR sequence of hyphens at the begining OR at the end of NAME with an empty string.