Strip leading and trailing hyphens in the resulting munged hostname.
Leading and trailing hyphens are not valid according to RFCs 952 and 1123.
(This problem surfaces immediately when using the default configuration of
OneFlow, since it names new VMs ending with a parenthesis.)
When setting the hostname from $SET_HOSTNAME, replace any characters
not allowed in hostnames (as specified in RFC 952) with a hyphen.
This is enables a VM template to safely use the VM's name as the
hostname (by setting the context variable SET_HOSTNAME=$NAME).
also updated 00-network and 05-hostname
One-context.service should be linked to systemd-networkd.service,
tying to do this using the Wants flag. Additionally since
one-context.service should now run before systemd-networkd.service
it's superfluous to restart the unit, this was edited out of
00-network. 05-hostname was edited to use the hostnameclt, the
echo style can probably be removed.
Addded Arch linux support for one-context. Moved the
init.d directory to distro specific directories in
order at add systemd compatability. 00-Network was
also reworked to use systemd-networkd.