[__hostname] Extend os switches with RedHat-derivatives (CentOS, Fedora, RedHat, Scientific)

This commit is contained in:
Dennis Camera 2019-10-06 17:56:37 +02:00
parent d43eb5b22f
commit 77210c349e
3 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ in
suse)
[ -f /etc/HOSTNAME ] && cat /etc/HOSTNAME
;;
scientific|centos)
centos|fedora|redhat|scientific)
[ -f /etc/sysconfig/network ] && awk -F= '/^HOSTNAME=/ { print $2 }' /etc/sysconfig/network
;;
freebsd)

View File

@ -58,12 +58,12 @@ EOF
fi
# Use the good old way to set the hostname. Also if hostnamectl fails.
case "$os" in
archlinux|debian|ubuntu|devuan|centos|coreos|alpine)
case $os in
archlinux|debian|ubuntu|devuan|coreos|alpine)
printf "printf '%%s\\\\n' '$name_should' > /etc/hostname\\n"
echo "hostname -F /etc/hostname"
;;
freebsd|openbsd)
centos|fedora|redhat|scientific|freebsd|openbsd)
# NOTE: Writing the hostname to file is done in the manifest.
echo "hostname '$name_should'"
;;

View File

@ -46,7 +46,7 @@ case "$os" in
# handled in gencode-remote
:
;;
scientific|centos)
centos|fedora|redhat|scientific)
__key_value sysconfig-hostname \
--file /etc/sysconfig/network \
--delimiter '=' \