unixwz0r

network-setup

Dec 30th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. #!/bin/bash
  2. #-------------------------------------------------------------------------------
  3. #Tux Hat Linux Installer Script
  4. #Developer: Gary Perreault
  5. #-------------------------------------------------------------------------------
  6.  
  7. #Global Settings
  8.  
  9. SYSTEMCTL1="systemctl enable NetworkManager.service"
  10. SYSTEMCTL2="systemctl start NetworkManager.service"
  11.  
  12. #Varibles to Ensure Configured Usually set to Not Configured until
  13. #task is done.
  14.  
  15. TASK1="[ ] Not Set"
  16. TASK2="[ ] Not Set"
  17.  
  18. # External Function Files that is required
  19. if [[ -f `pwd`/gfuncs.sh ]]; then
  20. source gfuncs.sh
  21. else
  22. echo "Error missing file: gfuncs.sh - Required for installer"
  23. exit 1
  24. fi
  25.  
  26. if [[ -f `pwd`/diskfuncs.sh ]]; then
  27. source diskfuncs.sh
  28. else
  29. echo "Error missing file: diskfuncs.sh - Required for installer"
  30. exit 1
  31. fi
  32.  
  33. prepmenu() {
  34. print_title6
  35. echo ""
  36. echo "${Bold}${White}${Underline}Tux Hat Linux Network Setup${Reset}"
  37. echo ""
  38. echo "${Bold}${White} 1. Setup DHCP Systemctl $TASK1"
  39. echo "${Bold}${White} 2. Setup NetworkManager Systemctl $TASK2"
  40. echo "${Bold}${White} Q. Quit "
  41. print_askopt
  42. read mnuopt
  43.  
  44. case $mnuopt in
  45. 1)
  46. network_interface
  47. TASK1="${Bold}${White}[${Bold}${Green}X${Bold}${White}] is Set"
  48. pause_function
  49. prepmenu
  50. ;;
  51. 2)
  52. $SYSTEMCTL1
  53. $SYSTEMCTL2
  54. TASK2="${Bold}${White}[${Bold}${Green}X${Bold}${White}] is Set"
  55. pause_function
  56. prepmenu
  57. ;;
  58. q)
  59. echo ""
  60. echo "${Purple}Now ${Cyan}the ${Blue}Network ${White}DHCP ${Yellow}is ${Green}setup!${Reset}"
  61. echo ""
  62. esac
  63.  
  64. }
  65. prepmenu
Advertisement
Add Comment
Please, Sign In to add comment