[__hostname] Compress state check

This commit is contained in:
Dennis Camera 2019-10-03 21:41:51 +02:00
parent 81ba849af8
commit ee440ec619

View file

@ -33,25 +33,18 @@ name_sysconfig=$(cat "$__object/explorer/hostname_sysconfig")
has_hostnamectl=$(cat "$__object/explorer/has_hostnamectl") has_hostnamectl=$(cat "$__object/explorer/has_hostnamectl")
################################################################################ ################################################################################
# If everything is ok -> exit # Check if the hostname is already correct
# #
if [ "$name_running" = "$name_should" ]; then
case "$os" in case "$os" in
archlinux|debian|suse|ubuntu|devuan|coreos|alpine) archlinux|debian|suse|ubuntu|devuan|coreos|alpine)
if [ "$name_config" = "$name_should" ] && [ "$name_running" = "$name_should" ]; then [ "$name_config" != "$name_should" ] || exit 0
exit 0
fi
;; ;;
scientific|centos|freebsd|openbsd) scientific|centos|freebsd|openbsd)
if [ "$name_sysconfig" = "$name_should" ] && [ "$name_running" = "$name_should" ]; then [ "$name_sysconfig" != "$name_should" ] || exit 0
exit 0
fi
;;
*)
if [ "$name_running" -a "$name_running" = "$name_should" ]; then
exit 0
fi
;; ;;
esac esac
fi
################################################################################ ################################################################################
# Setup hostname # Setup hostname