Kickstart set hostname issues FC5[Scanned]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I'm trying to setup a way to manually enter a hostname as part of the post install script in my Kickstart file. The process works, but the hostname does not register on our DNS servers *unless* I enter it on the Linux client under System > Administration > Network > Devices > Edit > DHCP Settings > Hostname.

The script I am using is:

%post
#switch to a virtual terminal
exec < /dev/tty3 > /dev/tty3
chvt 3
clear

#Get Hostname
echo -n "Enter Hostname: "
echo ""
read hostname

#Set Hostname
cat << EOF >> /etc/sysconfig/network~
NETWORKING=yes
HOSTNAME=$hostname
EOF

cat << EOF >> /etc/hosts~
127.0.0.1    $hostname    localhost.localdomain    localhost
EOF

mv /etc/hosts~ /etc/hosts
mv /etc/sysconfig/network~ /etc/sysconfig/network

#echo HOSTNAME=$hostname >> /etc/sysconfig/network
hostname $HOSTNAME
echo "Set Hostname....."

#Switch Back to tty1
exec < /dev/tty1 > /dev/tty1
chvt 1

The only thing I can assume is that the hostname is also stored in another file? Everything works fine after I add the hostname into the DHCP settings, until I do that the machine is unresolvable.

Any ideas?

Cheers

-Chris


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux