unixwz0r

UNIXwz0r - tuxhat-setup (re-written tuxhat-install script)

Jan 22nd, 2015
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.57 KB | None | 0 0
  1. #!/bin/bash
  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. # Top program dir is used for testing
  34.  
  35. #Global Settings
  36. ROOTDSK=`df / | sed '1d' | awk '{print $1}'`
  37. BOOTLOADERINSTALL="pacman -S --noconfirm syslinux"
  38. STH="setup-tuxhat"
  39. #BOOTLOADERCONFIG="syslinux-install_update -iam"
  40. #BOOTSETUP="nano /boot/syslinux/syslinux.cfg"
  41. #NETGUI="systemctl enable NetworkManager.service"
  42. #NETCMD="systemctl enable [email protected]"
  43. #NETWORKCHECK="ip link show"
  44. HOSTS="nano /etc/hosts"
  45. #HOSTNAME="echo tuxhatlinux > /etc/hostname"
  46. HWCLOCK="hwclock --systohc --utc"
  47. ROOTPWD="passwd"
  48. #EDITPACMAN="nano /etc/pacman.conf"
  49. #CPSKEL="cp -rv . /home/arch /home/${username}"
  50. EDITLOCALE="nano /etc/locale.gen"
  51. THLBASEPKG="pacman -S --noconfirm --force zsh figlet cowsay dwm conky gtk-engines arch-install-scripts networkmanager gimp openshot ppsspp pcsxr guvcview file-roller smplayer gparted gksu dmenu weechat archey3 feh yaourt awesome vicious nitrogen spacefm lxappearance mc tmux rxvt-unicode rtorrent xmms2 volumeicon network-manager-applet scrot vim geany firefox sudo file-roller lxmusic terminus-font alsa-utils xorg xorg-server xorg-xinit xterm xorg-twm openmotif mesa-demos inxi"
  52. AURBASEPKG="yaourt -S --noconfirm compton"
  53. VISUDO="visudo"
  54. EDITOR=nano
  55.  
  56. # Boot Loader Stuff
  57.  
  58. BOOTLOADER=" "
  59.  
  60. SLFILES="/opt/syslinux"                # Contains Syslinux related files
  61. SLTXT="/opt/syslinux/syslinux.txt"     # Contains filename list of Syslinux config files on in that directory
  62. SLCFGFILE="/boot/syslinux/syslinux.cfg" # Default config file
  63. CVSPLASH="/opt/syslinux/splash.png"    # Current Version Splash
  64.  
  65.  
  66. TITLENAME="Tux Hat Linux Installation Setup"
  67. DIALOGRC=${DIALOGRC}
  68. DISTNAME='Tux Hat Linux '
  69. DISTVER='v3.4'
  70. DASH='-'
  71. SCRIPTNAME='Tux Hat Linux Setup Script'
  72. MNT=/mnt
  73. CONFIGFILE=/home/gary/Test/setup-tuxhat.conf
  74.  
  75. if [[ -f $CONFIGFILE ]]; then
  76.   source $CONFIGFILE
  77. else
  78.   echo "Error missing file: setup-tuxhat.conf - Required by program"
  79.   exit 1
  80. fi
  81.  
  82. ### Program for making the UI
  83.  
  84. DIALOG=${DIALOG=dialog}
  85. #DIALOG=${DIALOG=Xdialog}
  86.  
  87. # Temp files
  88.  
  89. tmpfile=`tmpfile 2> /dev/null` || tmpfile=/tmp/tmpfile$$
  90. trap "rm  -f $tmpfile" 0 1 2 5 15
  91.  
  92. ################
  93. # Tuxhat-Setup #
  94. ################
  95. tuxhatlinuxmenuchoices()
  96.  
  97. {      
  98.         case $choice in
  99.        
  100.             "0")
  101.             $ROOTPWD           
  102.             ;;
  103.             "1")
  104.             create_new_user
  105.             ;;
  106.             "2")
  107.             cp_skel
  108.             ;;
  109.             "3")
  110.             $EDITLOCALE
  111.             ;;
  112.             "4")
  113.             $THLBASEPKG
  114.             ;;
  115.             "5")
  116.             $VISUDO
  117.             ;;
  118.             "6")
  119.             $HWCLOCK
  120.             ;;
  121.             "7")
  122.             configure_hostname
  123.             $HOSTS
  124.             ;;
  125.             "8")
  126.             $BOOTLOADERINSTALL
  127.             install_bootloader
  128.             ;;
  129.             "9")
  130.             cdmhddfiles
  131.             ;;
  132.            
  133.         esac
  134. }
  135.  
  136. tuxhatlinuxmenu()  # Arch Linux Base Main Menu Setup
  137.  
  138. {
  139.    
  140.     while :
  141.     do
  142.         DIALOGRC="$DIALOGRC" $DIALOG --backtitle "$DISTNAME$DISTVER $DASH $SCRIPTNAME " --no-shadow \
  143.         --ok-label 'Select' --cancel-label 'Exit' \
  144.         --title "$TITLENAME" --menu "Select Task 0-9 to Setup Tux Hat Linux Installation" 17 57 26 \
  145.         "0" "Root Password" \
  146.         "1" "Create New User" \
  147.         "2" "Copy Live ISO Skel to newly created User" \
  148.         "3" "Edit your locale /etc/locale.conf" \
  149.         "4" "Copy Tux Hat Linux Base packages from pacman" \
  150.         "5" "Edit sudoers" \
  151.         "6" "Setup Hwclock" \
  152.         "7" "Set Hostname & /etc/hosts" \
  153.         "8" "Setup Bootloader" \
  154.         "9" "Setup Console Display Manager" 2> $tmpfile
  155.                        
  156.         mmretval=$?
  157.         choice=`cat $tmpfile`
  158.                
  159.     case $mmretval in      
  160.     0)
  161.       tuxhatlinuxmenuchoices
  162.     ;;
  163.  
  164.     1)
  165.     if DIALOGRC="$DIALOGRC" $DIALOG --yesno "Do you want to exit?\n" 5 24
  166.     then
  167.         exit 0
  168.     fi
  169.    
  170.     ;;
  171.     255)
  172.    # echo "ESC key pressed"
  173.    
  174.     ;;
  175.     esac
  176. done
  177. }
  178.  
  179.  
  180. ########################################################################
  181. #
  182. #          End of Script -- Tux Hat Linux Development -- UNIXwz0r
  183. #
  184. ########################################################################
  185.  
  186. tuxhatlinuxmenu
Advertisement
Add Comment
Please, Sign In to add comment