Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ......
- %include /tmp/networkconfig
- %pre --interpreter=busybox
- exec < /dev/tty1 > /dev/tty1 2>&1
- chvt 1
- HOSTNAME=""
- IPADDR=""
- NETMASK=""
- GATEWAY=""
- DNS=""
- while [[ "$HOSTNAME" == "" ]] || [[ "${IPADDR}" == "" ]] || [[ "${NETMASK}" == "" ]] || [[ "${GATEWAY}" == "" ]] || [[ "${DNS}" == "" ]] ; do
- echo
- echo " *** Please enter the following details: *** "
- echo
- read -p "Hostname: " HOSTNAME
- read -p "IP Address: " IPADDR
- read -p "Netmask: " NETMASK
- read -p "Gateway: " GATEWAY
- read -p "DNS: " DNS
- done
- clear
- echo "network --bootproto=static --device=vmnic0 --ip=${IPADDR} --netmask=${NETMASK} --gateway=${GATEWAY} --nameserver=${DNS} --hostname=${HOSTNAME}" > /tmp/networkconfig
- echo -e "Applying the following configuration: \n"
- echo "Hostname = ${HOSTNAME}"
- echo "IP Address = ${IPADDR}"
- echo "Netmask = ${NETMASK}"
- echo "Gateway = ${GATEWAY}"
- echo -e "DNS = ${DNS}\n"
- sleep 5
- chvt 2
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement