blob: eaf26eea42af1708661df8d99402f1401aeea03b [file] [log] [blame]
#!/bin/ksh
#egan@us.ibm.com
#(C)IBM Corp
#
. $XCATROOT/lib/functions
logger -t xcat "Install: setting up /etc/hosts"
RESNAME=$(whatismyres2 $NODE)
ETH=$(tabdb $NODERESTAB $RESNAME $noderes_prinic)
if [ -z "$ETH" ]
then
ETH=eth0
fi
IP=$(host $NODE | head -1 | awk '{print $NF}')
HOSTNAME=$NODE
MIP=$(host $MASTER | head -1 | awk '{print $NF}')
mv -f /etc/hosts /etc/hosts.ORIG
case $OSVER in
sles[89]|suse8*|suse9*|suse10|ul*)
echo "127.0.0.1 localhost" >/etc/hosts
echo >>/etc/hosts
perl -pi -e 's/CHECK_ETC_HOSTS=.*/CHECK_ETC_HOSTS="no"/' /etc/sysconfig/suseconfig
perl -pi -e 's/BEAUTIFY_ETC_HOSTS=.*/BEAUTIFY_ETC_HOSTS="no"/' /etc/sysconfig/suseconfig
;;
rh*)
echo "127.0.0.1 localhost" >/etc/hosts
echo >>/etc/hosts
;;
esac
#if [ -n "$IP" ]
#then
# echo "$IP $HOSTNAME $HOSTNAME.$DOMAIN" >>/etc/hosts
#fi
#if [ -n "$MIP" ]
#then
# echo "$MIP $MASTER $MASTER.$DOMAIN" >>/etc/hosts
#fi
if [ -r /etc/hosts.x ]
then
cat /etc/hosts.x >>/etc/hosts
fi
exit 0