|
|
|
@ -28,14 +28,14 @@ fi |
|
|
|
|
os=$(cat "$__global/explorer/os") |
|
|
|
|
name_running=$(cat "$__global/explorer/hostname") |
|
|
|
|
name_config=$(cat "$__object/explorer/hostname_file") |
|
|
|
|
name_sysconfig=$(cat "$__object/explorer/hostname_file") |
|
|
|
|
name_sysconfig=$(cat "$__object/explorer/hostname_sysconfig") |
|
|
|
|
has_hostnamectl=$(cat "$__object/explorer/has_hostnamectl") |
|
|
|
|
|
|
|
|
|
################################################################################ |
|
|
|
|
# If everything is ok -> exit |
|
|
|
|
# |
|
|
|
|
case "$os" in |
|
|
|
|
archlinux|debian|ubuntu) |
|
|
|
|
archlinux|debian|suse|ubuntu) |
|
|
|
|
if [ "$name_config" = "$name_should" -a "$name_running" = "$name_should" ]; then |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
@ -45,6 +45,10 @@ case "$os" in |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo "Unsupported os: $os" >&2 |
|
|
|
|
exit 1 |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
################################################################################ |
|
|
|
@ -63,5 +67,9 @@ else |
|
|
|
|
centos) |
|
|
|
|
echo "hostname '$name_should'" |
|
|
|
|
;; |
|
|
|
|
suse) |
|
|
|
|
echo "hostname '$name_should'" |
|
|
|
|
echo "printf '%s\n' '$name_should' > /etc/HOSTNAME" |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
fi |
|
|
|
|