Advertisement
BSDG33KCLUB

tuxhat-install script

Nov 29th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. #!/bin/bash
  2. #-------------------------------------------------------------------------------
  3. #Tux Hat Linux Installer Script
  4. #Developer: Gary Perreault
  5. #-------------------------------------------------------------------------------
  6.  
  7.  
  8. if [[ -f `pwd`/sharedfuncs ]]; then
  9. source sharedfuncs
  10. else
  11. echo "missing file: sharedfuncs"
  12. exit 1
  13. fi
  14.  
  15. #ARCHLINUX U INSTALL {{{
  16. #WELCOME {{{
  17. welcome(){
  18. clear
  19. echo -e "${Bold}${Green}Welcome to Tux Hat Linux Installer Script${Purple}"
  20. print_line
  21. echo "Requirements:"
  22. echo "-> Archlinux installation"
  23. echo "-> Run script as root user"
  24. echo "-> Working internet connection"
  25. print_line
  26. echo "${Bold}${Red}Script can be cancelled at any time with CTRL+C"
  27. print_line
  28. echo "${Bold}${Yellow}Project Webpage: https://sourceforge.net/projects/tuxhatlinux/"
  29. pause_function
  30. print_title "${Green}Choose a root password"
  31. passwd
  32. pause_function
  33. print_title "${Bold}${Green}Setting up /etc/pacman.conf"
  34. pause_function
  35. nano /etc/pacman.conf
  36. echo ""
  37. }
  38. #}}}
  39. #SELECT/CREATE USER {{{
  40. select_user(){
  41. #CREATE NEW USER {{{
  42. create_new_user(){
  43. read -p "Username: " username
  44. username=`echo $username | tr '[:upper:]' '[:lower:]'`
  45. useradd -m -g users -G wheel -s /bin/bash ${username}
  46. chfn ${username}
  47. passwd ${username}
  48. while [[ $? -ne 0 ]]; do
  49. passwd ${username}
  50. done
  51. print_line
  52. echo "${Green}Copy Tux Hat Linux live iso SKEL to your new username"
  53. pause_function
  54. configure_user_account
  55. }
  56. #}}}
  57. #CONFIGURE USER ACCOUNT {{{
  58. configure_user_account(){
  59. #BASHRC {{{
  60. print_title "${Green}Copy Tux Hat Linux live iso SKEL to your new username"
  61. cp -rv . /home/arch /home/${username}
  62. chown -R ${username}:users /home/${username}
  63. rm -rf /home/arch
  64. }
  65. #}}}
  66. print_title "${Green}Create a new user, and THL Live ISO Skel will be copy to it :)"
  67. users_list=(`cat /etc/passwd | grep "/home" | cut -d: -f1`);
  68. PS3="$prompt1"
  69. echo "Avaliable Users:"
  70. if [[ $(( ${#users_list[@]} )) -gt 0 ]]; then
  71. print_warning "WARNING: THE SELECTED USER MUST HAVE SUDO PRIVILEGES"
  72. else
  73. echo ""
  74. fi
  75. select OPT in "${users_list[@]}" "Create new user"; do
  76. if [[ $OPT == "Create new user" ]]; then
  77. create_new_user
  78. elif contains_element "$OPT" "${users_list[@]}"; then
  79. username=$OPT
  80. else
  81. invalid_option
  82. fi
  83. [[ -n $OPT ]] && break
  84. done
  85. [[ ! -f /home/${username}/.bashrc ]] && configure_user_account;
  86. if [ -n "$http_proxy" ]; then
  87. echo "proxy = $http_proxy" > /home/${username}/.curlrc
  88. chown ${username}:users /home/${username}/.curlrc
  89. fi
  90. echo ""
  91. echo ""
  92. print_line
  93. echo "${Yellow}Now we are going to setup locale.gen"
  94. pause_function
  95. print_title "${Yellow}Please select your locale"
  96. nano /etc/locale.gen
  97. locale-gen
  98. echo ""
  99. echo ""
  100. print_line
  101. echo "${Red}Now going to install Tux Hat Linux Base Packages"
  102. pause_function
  103. print_title "${Green}Tux Hat Linux Base Install"
  104. pacman -S arch-install-scripts networkmanager gparted gksu irssi archey3 feh yaourt fluxbox nitrogen pcmanfm lxappearance mc tmux rxvt-unicode rtorrent xmms2 volumeicon network-manager-applet dmenu scrot vim geany firefox sudo file-roller terminus-font alsa-utils xorg xorg-server xorg-xinit
  105. echo ""
  106. print_line
  107. echo "${Yellow}Now we are going to install bmpanel2, compton, and toilet from yaourt in AUR packages"
  108. pause_function
  109. print_title "${Red}Fetching files from AUR"
  110. yaourt -S bmpanel2 compton toilet
  111. print_line
  112. echo -e "${Yellow}Now let's edit your sudoers"
  113. pause_function
  114. visudo
  115. print_line
  116. echo "${Green}Tux Hat Linux Base is done installing... almost done, now we got a few more manual settings todo: simple locale settings, systemd services, and finally bootloader"
  117.  
  118. }
  119.  
  120. #FINISH {{{
  121. finish(){
  122. print_title "WARNING: PACKAGES INSTALLED FROM AUR"
  123. print_danger "List of packages not officially supported that may kill your cat:"
  124. pause_function
  125. AUR_PKG_LIST="${AUI_DIR}/aur_pkg_list.log"
  126. pacman -Qm | awk '{print $1}' > $AUR_PKG_LIST
  127. less $AUR_PKG_LIST
  128. print_title "INSTALL COMPLETED"
  129. echo -e "Thats should do it!"
  130. #REBOOT
  131. read -p "Reboot your system [y/N]: " OPTION
  132. [[ $OPTION == y ]] && reboot
  133. exit 0
  134. }
  135. #}}}
  136.  
  137. welcome
  138. check_root
  139. check_archlinux
  140. check_hostname
  141. check_connection
  142. check_pacman_blocked
  143. check_multilib
  144. pacman_key
  145. system_update
  146. language_selector
  147. configure_sudo
  148. select_user
  149.  
  150. #}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement