Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Created January 26, 2014 11:01
Show Gist options
  • Save e-minguez/8631148 to your computer and use it in GitHub Desktop.
Save e-minguez/8631148 to your computer and use it in GitHub Desktop.
ask hostname in kickstart per
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6
#!/bin/sh
echo
CONFIRM=no
while [ "$CONFIRM" != "y" ]
do
echo -n "Hostname: "
read HOSTNAME
if [ "$HOSTNAME" == "" ]
then
HOSTLINE="network --bootproto=dhcp"
echo -n "Hostname empty?: "
read CONFIRM
else
HOSTLINE="network --bootproto=dhcp --hostname=$HOSTNAME"
echo -n "Sure?: "
read CONFIRM
fi
done
echo $HOSTLINE > /tmp/network.ks
hostname $HOSTNAME
chvt 1
exec < /dev/tty1 > /dev/tty1 2> /dev/tty1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment