Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #-------------------------------------------------------------------------------
- #Tux Hat Linux Installer Script
- #Developer: Gary Perreault
- #-------------------------------------------------------------------------------
- if [[ -f `pwd`/sharedfuncs ]]; then
- source sharedfuncs
- else
- echo "missing file: sharedfuncs"
- exit 1
- fi
- #ARCHLINUX U INSTALL {{{
- #WELCOME {{{
- welcome(){
- clear
- echo -e "${Bold}${Green}Welcome to Tux Hat Linux Installer Script${Purple}"
- print_line
- echo "Requirements:"
- echo "-> Archlinux installation"
- echo "-> Run script as root user"
- echo "-> Working internet connection"
- print_line
- echo "${Bold}${Red}Script can be cancelled at any time with CTRL+C"
- print_line
- echo "${Bold}${Yellow}Project Webpage: https://sourceforge.net/projects/tuxhatlinux/"
- pause_function
- print_title "${Green}Choose a root password"
- passwd
- pause_function
- print_title "${Bold}${Green}Setting up /etc/pacman.conf"
- pause_function
- nano /etc/pacman.conf
- echo ""
- }
- #}}}
- #SELECT/CREATE USER {{{
- select_user(){
- #CREATE NEW USER {{{
- create_new_user(){
- read -p "Username: " username
- username=`echo $username | tr '[:upper:]' '[:lower:]'`
- useradd -m -g users -G wheel -s /bin/bash ${username}
- chfn ${username}
- passwd ${username}
- while [[ $? -ne 0 ]]; do
- passwd ${username}
- done
- print_line
- echo "${Green}Copy Tux Hat Linux live iso SKEL to your new username"
- pause_function
- configure_user_account
- }
- #}}}
- #CONFIGURE USER ACCOUNT {{{
- configure_user_account(){
- #BASHRC {{{
- print_title "${Green}Copy Tux Hat Linux live iso SKEL to your new username"
- cp -rv . /home/arch /home/${username}
- chown -R ${username}:users /home/${username}
- rm -rf /home/arch
- }
- #}}}
- print_title "${Green}Create a new user, and THL Live ISO Skel will be copy to it :)"
- users_list=(`cat /etc/passwd | grep "/home" | cut -d: -f1`);
- PS3="$prompt1"
- echo "Avaliable Users:"
- if [[ $(( ${#users_list[@]} )) -gt 0 ]]; then
- print_warning "WARNING: THE SELECTED USER MUST HAVE SUDO PRIVILEGES"
- else
- echo ""
- fi
- select OPT in "${users_list[@]}" "Create new user"; do
- if [[ $OPT == "Create new user" ]]; then
- create_new_user
- elif contains_element "$OPT" "${users_list[@]}"; then
- username=$OPT
- else
- invalid_option
- fi
- [[ -n $OPT ]] && break
- done
- [[ ! -f /home/${username}/.bashrc ]] && configure_user_account;
- if [ -n "$http_proxy" ]; then
- echo "proxy = $http_proxy" > /home/${username}/.curlrc
- chown ${username}:users /home/${username}/.curlrc
- fi
- echo ""
- echo ""
- print_line
- echo "${Yellow}Now we are going to setup locale.gen"
- pause_function
- print_title "${Yellow}Please select your locale"
- nano /etc/locale.gen
- locale-gen
- echo ""
- echo ""
- print_line
- echo "${Red}Now going to install Tux Hat Linux Base Packages"
- pause_function
- print_title "${Green}Tux Hat Linux Base Install"
- 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
- echo ""
- print_line
- echo "${Yellow}Now we are going to install bmpanel2, compton, and toilet from yaourt in AUR packages"
- pause_function
- print_title "${Red}Fetching files from AUR"
- yaourt -S bmpanel2 compton toilet
- print_line
- echo -e "${Yellow}Now let's edit your sudoers"
- pause_function
- visudo
- print_line
- 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"
- }
- #FINISH {{{
- finish(){
- print_title "WARNING: PACKAGES INSTALLED FROM AUR"
- print_danger "List of packages not officially supported that may kill your cat:"
- pause_function
- AUR_PKG_LIST="${AUI_DIR}/aur_pkg_list.log"
- pacman -Qm | awk '{print $1}' > $AUR_PKG_LIST
- less $AUR_PKG_LIST
- print_title "INSTALL COMPLETED"
- echo -e "Thats should do it!"
- #REBOOT
- read -p "Reboot your system [y/N]: " OPTION
- [[ $OPTION == y ]] && reboot
- exit 0
- }
- #}}}
- welcome
- check_root
- check_archlinux
- check_hostname
- check_connection
- check_pacman_blocked
- check_multilib
- pacman_key
- system_update
- language_selector
- configure_sudo
- select_user
- #}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement