#!/bin/sh
#
# DNS-before-NIS in nsswitch.conf makes RARP to respond with FQN
# So, dirty fix is to cut out the domainname at a late phase of Jumpstart
#
# In 2.6, somehow it doesn help, anyway, so we cut it out in Std
# begin script. But this script is also run - just in case.
#
# aryzhov Fri Feb  6 10:22:11 JST 1998
#

FILES="
 ./hosts
 ./hostname.*
 ./net/ticots/hosts
 ./net/ticlts/hosts
 ./net/ticotsord/hosts
 ./nodename
"
newname=`cat /etc/nodename | awk -F. '{print $1}'`
echo New name is $newname
chroot /a /bin/sh -c "`which uname` -S $newname"
chroot /a /bin/sh -c "`which hostname` $newname"

DOM=`domainname`

cd /a/etc || exit 1

for i in $FILES ; do
 rm -f $i.*.FQN
 rm -f $i.FQN
 cp $i $i.FQN
 sed -e s:.${DOM}:: < $i.FQN | sed -e s:.${DOM}:: > $i
done
