unixwz0r

UNIXwz0r - setup-tuxhat (re-written example)

Jan 21st, 2015
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.67 KB | None | 0 0
  1. #!/bin/bash -x
  2. #----------------------------------------------------------------------------------------
  3. # Script Created by Gary Perreault - Tux Hat Linux Project ([email protected])
  4. # IRC Freenode #bsdgeekclub @UNIXwz0r @Vincent0ne-
  5. # Distro Sourceforge - https://sourceforge.net/projects/tuxhatlinux/
  6. # Distro Youtube - https://www.youtube.com/channel/UCDXUtAdTuZSRDFgBHC2gaGA
  7. # Distro Pastebin - http://pastebin.com/u/unixwz0r
  8. # Distro Deviantart -http://ipodpunker.deviantart.com/
  9. # Distro Dailymotion - http://www.dailymotion.com/tuxhatlinux
  10. #----------------------------------------------------------------------------------------
  11. #This program is free software: you can redistribute it and/or modify
  12. #it under the terms of the GNU General Public License as published by
  13. #the Free Software Foundation, either version 3 of the License, or
  14. #(at your option) any later version.
  15. #
  16. #This program is distributed in the hope that it will be useful,
  17. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. #GNU General Public License for more details.
  20. #
  21. #You should have received a copy of the GNU General Public License
  22. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  23. #----------------------------------------------------------------------------------------
  24. # Run this script after your first boot with archlinux (as root)
  25. #----------------------------------------------------------------------------------------
  26. # Explaination of the Script:
  27. #
  28. # Setup-Tuxhat using Dialog. The main menu script has like 8 seperate setup scripts.
  29. #
  30. # Scripts are listed in # Scripts below
  31. ##########################################################################################
  32.  
  33.  
  34. # Top program dir is used for testing
  35.  
  36. # Global Stuff
  37. TITLENAME="Tux Hat Linux Main Setup"
  38. DIALOGRC=${DIALOGRC}
  39. DISTNAME='Tux Hat Linux '
  40. DISTVER='v3.4'
  41. DASH='-'
  42. SCRIPTNAME='Main Menu Setup'
  43. MNT=/mnt
  44. CONFIGFILE=/home/gary/Test/setup-tuxhat.conf
  45.  
  46. # Scripts    
  47. SCRIPT1="/home/gary/Test/arch-setup"
  48. SCRIPT2="/home/gary/Test/tuxhat-setup"
  49. SCRIPT3="/home/gary/Test/network-setup"
  50. SCRIPT4="/home/gary/Test/vbox-guest-setup"
  51. SCRIPT5="/home/gary/Test/video-setup"
  52. SCRIPT6="/home/gary/Test/compton-setup"
  53. SCRIPT7="/home/gary/Test/steam-setup"
  54. SCRIPT8="/home/gary/Test/local-setp"
  55.  
  56. if [[ -f $CONFIGFILE ]]; then
  57.   source $CONFIGFILE
  58. else
  59.   echo "Error missing file: setup-tuxhat.conf - Required by program"
  60.   exit 1
  61.   source $SCRIPT1
  62. fi
  63.  
  64. # Linux name and version is set in its own config file.
  65. #VERSIONINFO=$PROGDIR/etc/distver.conf
  66. #
  67. #if [[ -f $VERSIONINFO ]]; then
  68. #  source $VERSIONINFO
  69. #else
  70. #  echo "Error missing file: distver.conf - Required by program"
  71. #  echo "Installer's Directory is $PROGDIR/etc"
  72. #  exit 1
  73. #fi
  74.  
  75.  
  76. ### Program for making the UI
  77. DIALOG=${DIALOG=dialog}
  78. #DIALOG=${DIALOG=Xdialog}
  79.  
  80. # Temp files
  81.  
  82. tmpfile=`tmpfile 2> /dev/null` || tmpfile=/tmp/tmpfile$$
  83. trap "rm  -f $tempfile" 0 1 2 5 15
  84.  
  85. ####################
  86. # Main Menu Config #
  87. ####################
  88. setuptuxhatmenuchoices() {
  89.  
  90.  
  91.         case $choice in
  92.        
  93.          "Arch Linux Based Setup")
  94.          $SCRIPT1
  95.          ;;
  96.          "Tux Hat Linux Setup")
  97.          $SCRIPT2
  98.          ;;
  99.          "Network Setup (DHCP)")
  100.          $SCRIPT3
  101.          ;;
  102.          "Virtualbox Guest Setup")
  103.          $SCRIPT4
  104.          ;;
  105.          "Video Setup")
  106.          $SCRIPT5
  107.          ;;
  108.          "Compton Composite Setup")
  109.          $SCRIPT6
  110.          ;;
  111.          "Steam Client Setup")
  112.          $SCRIPT7
  113.          ;;
  114.          "Copy ISO to HDD without network")
  115.          $SCRIPT8
  116.          ;;
  117.            
  118.         esac
  119. }
  120. {
  121.  
  122.    
  123.     while :
  124.     do
  125.         DIALOGRC="$DIALOGRC" $DIALOG --backtitle "$DISTNAME$DISTVER $DASH $SCRIPTNAME " --no-shadow \
  126.         --ok-label 'Select' --cancel-label 'Exit' \
  127.         --title "$FUNCTION" --menu "Select Setup Script" 15 46 16 \
  128.         "Arch Linux Based Setup" "[Root]" \
  129.         "Tux Hat Linux Setup" "[Root]" \
  130.         "Network Setup (DHCP)" "[Root]" \
  131.         "Virtualbox Guest Setup" "[Root]" \
  132.         "Video Setup" "[User]" \
  133.         "Compton Composite Setup" "[Root]" \
  134.         "Steam Client Setup" "[Root]" \
  135.         "Copy ISO to HDD without network" "[Root]" 2> $tmpfile
  136.        
  137.        
  138.        
  139.        
  140.         mmretval=$?
  141.        
  142.         choice=`cat $tmpfile`
  143.        
  144.     case $mmretval in      
  145.     0)
  146.       setuptuxhatmenuchoices
  147.     ;;
  148.  
  149.     1)
  150.     if DIALOGRC="$DIALOGRC" $DIALOG --yesno "Do you want to exit?\n" 5 24
  151.     then
  152.         exit 0
  153.     fi
  154.    
  155.     ;;
  156.     255)
  157.    # echo "ESC key pressed"
  158.    
  159.     ;;
  160.     esac
  161. done
  162.  
  163. }
  164.  
  165.  
  166. ########################################################################
  167. #
  168. #          End of Script -- Tux Hat Linux Development -- UNIXwz0r
  169. #
  170. ########################################################################
Advertisement
Add Comment
Please, Sign In to add comment