[__hostname] Little bit of clean up

This commit is contained in:
Dennis Camera 2019-11-16 14:58:30 +01:00
parent 88947d45b3
commit a885082534

View file

@ -52,7 +52,7 @@ else
esac esac
fi fi
if test -n "${max_len}" && test "$(printf '%s' "${name_should}" | wc -c)" -gt "${max_len}" if test -n "$max_len" && test "$(printf '%s' "$name_should" | wc -c)" -gt "$max_len"
then then
printf "Host name too long. Up to %u characters allowed.\n" "${max_len}" >&2 printf "Host name too long. Up to %u characters allowed.\n" "${max_len}" >&2
exit 1 exit 1
@ -93,10 +93,10 @@ in
fi fi
;; ;;
gentoo) gentoo)
if test -z "$has_hostnamectl"
then
# Only write to /etc/conf.d/hostname on OpenRC-based installations. # Only write to /etc/conf.d/hostname on OpenRC-based installations.
# On systemd use hostnamectl(1) in gencode-remote. # On systemd use hostnamectl(1) in gencode-remote.
if test -z "$has_hostnamectl"
then
__key_value '/etc/conf.d/hostname:hostname' \ __key_value '/etc/conf.d/hostname:hostname' \
--file /etc/conf.d/hostname \ --file /etc/conf.d/hostname \
--delimiter '=' --exact_delimiter \ --delimiter '=' --exact_delimiter \