I have a kickstart file that takes a hostname in the %pre section. I cannot seem to figure out how to get it two the first. As you see it sends the server information to another device which then customizes the server based on another database. I need to figure out how to take the hostname parameter in pre however and send it to post.
%pre
#!/bin/sh
exec < /dev/tty6 > /dev/tty6
chvt 6
clear
echo "################################"
echo "# Running Pre Configuration #"
echo "################################"
echo -n "Give hostname: "
read hostname
hostname $hostname
echo $hostname > /home/hostname
echo $hostname > /mnt/sysimage/home/hostname
exec < /dev/tty1 > /dev/tty1
chvt 1
%packages
@base
@core
%post
exec < /dev/tty6 > /dev/tty6
chvt 6
ip0=`ifconfig eth0 |grep -e addr:10.0|cut -d':' -f2|awk '{print $1}'`;
ip1=`ifconfig eth1 |grep -e addr:10.0|cut -d':' -f2|awk '{print $1}'`;
mac0=`ifconfig eth0 |grep HWaddr|awk '{print $5}'`;
mac1=`ifconfig eth1 |grep HWaddr|awk '{print $5}'`;
os=`cat /home/hostname` ;
hostname=`cat /home/hostname`;
service sshd start
echo "$ip0^$mac0^$ip1^$mac1^$os^$hostname^none" >/dev/tcp/10.0.0.1/999
exec < /dev/tty1 > /dev/tty1
chvt 1
In the above the "hostname $hostname" does work for some O.S's but not all. I would like to make it dynamic based on the information submitted in pre but am having no luck.