[__hostname] Add support for Slackware

This commit is contained in:
Dennis Camera 2019-10-27 15:14:09 +01:00
parent 66c85230a0
commit 5eb9fec550
2 changed files with 8 additions and 2 deletions

View file

@ -66,7 +66,7 @@ in
"&& hostnamectl set-hostname '$name_should'" \ "&& hostnamectl set-hostname '$name_should'" \
"|| hostname '$name_should'" "|| hostname '$name_should'"
;; ;;
centos|fedora|redhat|scientific|freebsd|netbsd|gentoo|void) centos|fedora|redhat|scientific|freebsd|netbsd|gentoo|slackware|void)
echo "hostname '$name_should'" echo "hostname '$name_should'"
;; ;;
macosx) macosx)

View file

@ -41,7 +41,7 @@ else
case $os case $os
in in
# RedHat-derivatives and BSDs # RedHat-derivatives and BSDs
centos|fedora|redhat|scientific|freebsd|netbsd|openbsd) centos|fedora|redhat|scientific|freebsd|netbsd|openbsd|slackware)
# Hostname is FQDN # Hostname is FQDN
name_should="${__target_host}" name_should="${__target_host}"
;; ;;
@ -130,6 +130,12 @@ in
openbsd) openbsd)
echo "$name_should" | __file /etc/myname --source - echo "$name_should" | __file /etc/myname --source -
;; ;;
slackware)
# We write the FQDN into /etc/HOSTNAME.
# But /etc/rc.d/rc.M will only read the first component from this file
# and set it as the running hostname on boot.
echo "$name_should" | __file /etc/HOSTNAME --source -
;;
suse) suse)
# We write into /etc/HOSTNAME for backwards-compatibility. Modern SuSE # We write into /etc/HOSTNAME for backwards-compatibility. Modern SuSE
# has hostnamectl anyway and symlinks /etc/HOSTNAME to /etc/hostname. # has hostnamectl anyway and symlinks /etc/HOSTNAME to /etc/hostname.