Commit 104ba047 authored by Paul Cammish's avatar Paul Cammish
Browse files

Don't enforce the hostname, but warn on install script

parent e42f61b5
......@@ -97,23 +97,23 @@ fi
# partially mangled hosts files, but will deal with someone changing the
# hostname but not also changing /etc/hosts
#
if [ $( grep -c $_HOSTNAME '/etc/hosts' ) == 0 ]; then
echo "I: Updating hostname configuration with complete name."
if hostname -i > /dev/null ; then
hostname_ips="$( hostname -i )"
else
hostname_ips="127.0.1.1"
fi
sed -i "s|^$hostname_ips|# $hostname_ips|" '/etc/hosts'
sed -i "1i$hostname_ips\t$_HOSTNAME $( echo $_HOSTNAME | cut -d '.' -f 1 )" '/etc/hosts'
export HOSTNAME="$_HOSTNAME"
hostname -b "$_HOSTNAME"
fi
#if [ $( grep -c $_HOSTNAME '/etc/hosts' ) == 0 ]; then
# echo "I: Updating hostname configuration with complete name."
# if hostname -i > /dev/null ; then
# hostname_ips="$( hostname -i )"
# else
# hostname_ips="127.0.1.1"
# fi
# sed -i "s|^$hostname_ips|# $hostname_ips|" '/etc/hosts'
# sed -i "1i$hostname_ips\t$_HOSTNAME $( echo $_HOSTNAME | cut -d '.' -f 1 )" '/etc/hosts'
# export HOSTNAME="$_HOSTNAME"
# hostname -b "$_HOSTNAME"
#fi
#
# Enforce using the full hostname
#
echo "I: Checking hostname configuration files."
#echo "I: Checking hostname configuration files."
if [ "$HOSTNAME" != "$_HOSTNAME" ]; then export HOSTNAME="$_HOSTNAME"; fi
if [ "$( hostname )" != "$_HOSTNAME" ]; then hostname -b "$_HOSTNAME" ; fi
if [ "$( cat /etc/hostname )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/hostname" ; fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment