mambawelcome: fix configuring domain with hostnamectl (pass HOSTNAME.DOMAIN as 'hostnamectl set-hostname' option)
This commit is contained in:
parent
9e74f43f42
commit
e429fbd4ab
@ -149,13 +149,15 @@ sh -c "echo $INSTALL_ROOT_PASSWORD | passwd --stdin" || {
|
||||
|
||||
# set hostname and domain
|
||||
[[ "$INSTALL_HOSTNAME" ]] && {
|
||||
if [ "${INSTALL_HOSTNAME/.*}" != "${INSTALL_HOSTNAME}" -o "${INSTALL_DOMAIN}" = "localdomain" ]; then
|
||||
hostnamectl set-hostname $INSTALL_HOSTNAME
|
||||
sed -i "s|HOSTNAME=.*|HOSTNAME=$INSTALL_HOSTNAME|" \
|
||||
/etc/sysconfig/network
|
||||
|
||||
[[ "$INSTALL_DOMAIN" ]] || INSTALL_DOMAIN="localdomain"
|
||||
if [ "${INSTALL_DOMAIN}" != "localdomain" ]; then
|
||||
sed -i "s|\(127\.0\.0\.1\W*\)\(.*\)|\1 $INSTALL_HOSTNAME.$INSTALL_DOMAIN $INSTALL_HOSTNAME localhost.localdomain localhost|" \
|
||||
/etc/hosts
|
||||
fi
|
||||
elif [ "${INSTALL_DOMAIN}" != "localdomain" ]; then
|
||||
hostnamectl set-hostname $INSTALL_HOSTNAME.$INSTALL_DOMAIN
|
||||
fi
|
||||
}
|
||||
|
||||
# set samba configuration file
|
||||
|
Loading…
Reference in New Issue
Block a user