Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ......
  2. %include /tmp/networkconfig
  3.  
  4. %pre --interpreter=busybox
  5.  
  6. exec < /dev/tty1 > /dev/tty1 2>&1
  7. chvt 1
  8. HOSTNAME=""
  9. IPADDR=""
  10. NETMASK=""
  11. GATEWAY=""
  12. DNS=""
  13.  
  14. while [[ "$HOSTNAME" == "" ]] || [[ "${IPADDR}" == "" ]] || [[ "${NETMASK}" == "" ]] || [[ "${GATEWAY}" == "" ]] || [[ "${DNS}" == "" ]] ; do
  15. echo
  16. echo " *** Please enter the following details: *** "
  17. echo
  18. read -p "Hostname: " HOSTNAME
  19. read -p "IP Address: " IPADDR
  20. read -p "Netmask: " NETMASK
  21. read -p "Gateway: " GATEWAY
  22. read -p "DNS: " DNS
  23. done
  24. clear
  25.  
  26. echo "network --bootproto=static --device=vmnic0 --ip=${IPADDR} --netmask=${NETMASK} --gateway=${GATEWAY} --nameserver=${DNS} --hostname=${HOSTNAME}" > /tmp/networkconfig
  27.  
  28. echo -e "Applying the following configuration: \n"
  29. echo "Hostname = ${HOSTNAME}"
  30. echo "IP Address = ${IPADDR}"
  31. echo "Netmask = ${NETMASK}"
  32. echo "Gateway = ${GATEWAY}"
  33. echo -e "DNS = ${DNS}\n"
  34. sleep 5
  35. chvt 2
  36.  
  37. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement