forked from ungleich-public/cdist
[__hostname] Compress state check
This commit is contained in:
parent
81ba849af8
commit
ee440ec619
1 changed files with 11 additions and 18 deletions
|
@ -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
|
||||||
#
|
#
|
||||||
case "$os" in
|
if [ "$name_running" = "$name_should" ]; then
|
||||||
archlinux|debian|suse|ubuntu|devuan|coreos|alpine)
|
case "$os" in
|
||||||
if [ "$name_config" = "$name_should" ] && [ "$name_running" = "$name_should" ]; then
|
archlinux|debian|suse|ubuntu|devuan|coreos|alpine)
|
||||||
exit 0
|
[ "$name_config" != "$name_should" ] || exit 0
|
||||||
fi
|
;;
|
||||||
;;
|
scientific|centos|freebsd|openbsd)
|
||||||
scientific|centos|freebsd|openbsd)
|
[ "$name_sysconfig" != "$name_should" ] || exit 0
|
||||||
if [ "$name_sysconfig" = "$name_should" ] && [ "$name_running" = "$name_should" ]; then
|
;;
|
||||||
exit 0
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
|
||||||
*)
|
|
||||||
if [ "$name_running" -a "$name_running" = "$name_should" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Setup hostname
|
# Setup hostname
|
||||||
|
|
Loading…
Reference in a new issue