Created
October 1, 2016 14:00
-
-
Save miticojo/1ff329541dd0b04894f09361edeb7b47 to your computer and use it in GitHub Desktop.
Kickstart Prompt for user input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ...... | |
| %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 | |
| ............ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment