Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #-------------------------------------------------------------------------------
- #Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com
- #Inspired by Andreas Freitag, aka nexxx script
- #Modified and adapted for the Freedom and for Parabola distro by André Silva (Emulatorman) mailto: andre.paulista[at]adinet[dot]com[dot]uy
- #-------------------------------------------------------------------------------
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation, either version 3 of the License, or
- #(at your option) any later version.
- #
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- #-------------------------------------------------------------------------------
- # Run this script after your first boot with parabola (as root)
- GNOME=0
- ARCHI=`uname -m`
- # Automatically detects the system language based on your rc.conf
- LOCATION=`cat /etc/rc.conf | sed -n '/LOCALE=/p' | sed '1!d' | cut -c9-13`
- LOCATION_KDE=`echo $LOCATION | tr '[:upper:]' '[:lower:]'`
- LOCATION_GNOME=`echo $LOCATION | tr '[:upper:]' '[:lower:]' | sed 's/_/-/'`
- LOCATION_LO=`echo $LOCATION | sed 's/_/-/'`
- function question_for_answer(){ #{{{
- read -p "$1 [y][n]: " OPTION
- echo ""
- } #}}}
- function install_status(){ #{{{
- if [ $? -ne 0 ] ; then
- CURRENT_STATUS=-1
- else
- CURRENT_STATUS=1
- fi
- } #}}}
- function print_line(){ #{{{
- echo "--------------------------------------------------------------------------------"
- } #}}}
- function print_title (){ #{{{
- clear
- echo "#-------------------------------------------------------------------------------"
- echo -e "# $1"
- echo "#-------------------------------------------------------------------------------"
- echo ""
- } #}}}
- function add_new_daemon(){ #{{{
- remove_daemon "$1"
- sed -i '/DAEMONS[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
- } #}}}
- function remove_daemon(){ #{{{
- sed -i '/DAEMONS[=]/s/'"$1"' //' /etc/rc.conf
- } #}}}
- function add_new_module(){ #{{{
- remove_module "$1"
- sed -i '/MODULES[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
- #sed -i '/MODULES[=]/s/^[^ ]*\>/& '"$1"'/' /etc/rc.conf
- } #}}}
- function remove_module(){ #{{{
- sed -i '/MODULES[=]/s/'"$1"' //' /etc/rc.conf
- } #}}}
- function finish_function(){ #{{{
- print_line
- echo "Continue with RETURN"
- read
- clear
- } #}}}
- function sumary(){ #{{{
- case $CURRENT_STATUS in
- 0)
- print_line
- echo "$1 not successfull (Canceled)"
- ;;
- -1)
- print_line
- echo "$1 not successfull (Error)"
- ;;
- 1)
- print_line
- echo "$1 successfull"
- ;;
- *)
- print_line
- echo "WRONG ARG GIVEN"
- ;;
- esac
- } #}}}
- #begin #{{{
- clear
- echo "Welcome to the Ultimate Parabola install script by helmuthdu"
- echo "Inspired by freitag parabola helper script install"
- echo "Modified and adapted for the Freedom and for Parabola distro by emulatorman"
- print_line
- echo "Requirements:"
- echo "-> Parabola installation"
- echo "-> Run script as root user"
- echo "-> Working internet connection"
- print_line
- echo "Script can be canceled all the time with CTRL+C"
- print_line
- echo "OPEN THIS SCRIPTS AND READ ALL OPTIONS BEFORE USE IT"
- echo "Not recommended use this script more then 1 time (create duplicate values)"
- echo "This version is still in BETA. Send bugreports to: "
- echo "helmuthdu at gmail dot com"
- finish_function
- #}}}
- #system update #{{{
- print_title "UPDATING YOUR SYSTEM"
- pacman -Syu
- read -p "Reboot your system [y][n]: " OPTION
- if [ $OPTION = "y" ]; then
- reboot
- exit 0
- fi
- #}}}
- #create a new user #{{{
- print_title "CREATE USER ACCOUNT"
- read -p "New user name: " USERNAME
- useradd -m -g users -G users,audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash $USERNAME
- passwd $USERNAME
- #set user as sudo #{{{
- pacman -S --noconfirm sudo
- ## Uncomment to allow members of group wheel to execute any command
- sed -i '/%wheel ALL=(ALL) ALL/s/^#//' /etc/sudoers
- ## Same thing without a password (not secure)
- #sed -i '/%wheel ALL=(ALL) NOPASSWD: ALL/s/^#//' /etc/sudoers
- #}}}
- #base system #{{{
- print_title "BASH TOOLS - https://wiki.parabolagnulinux.org/index.php/Bash"
- pacman -S --noconfirm curl bc rsync mlocate bash-completion vim
- print_title "(UN)COMPRESS TOOLS - https://wiki.parabolagnulinux.org/index.php/P7zip-libre"
- pacman -S --noconfirm tar gzip bzip2 unzip unrar p7zip-libre
- print_title "DBUS - https://wiki.parabolagnulinux.org/index.php/D-Bus"
- pacman -S --noconfirm dbus
- add_new_daemon "dbus"
- print_title "ACPI - https://wiki.parabolagnulinux.org/index.php/ACPI_modules"
- pacman -S --noconfirm acpi acpid
- add_new_daemon "acpid"
- finish_function
- #}}}
- print_title "CUPS - https://wiki.parabolagnulinux.org/index.php/Cups"
- pacman -S --noconfirm cups-libre ghostscript-libre gsfonts
- pacman -S --noconfirm gutenprint foomatic-db foomatic-db-engine foomatic-filters-libre hplip-libre splix cups-pdf
- add_new_daemon "@cupsd"
- print_title "NTFS/FAT - https://wiki.parabolagnulinux.org/index.php/Ntfs"
- pacman -S --noconfirm ntfs-3g ntfsprogs dosfstools
- print_title "SSH - https://wiki.parabolagnulinux.org/index.php/Ssh"
- pacman -S --noconfirm rssh openssh
- add_new_daemon "@sshd"
- #configure ssh/samba #{{{
- echo -e "sshd: ALL\n# End of file" > /etc/hosts.allow
- echo -e "ALL: ALL: DENY\n# End of file" > /etc/hosts.deny
- #ssh_conf #{{{
- sed -i '/ListenAddress/s/^#//' /etc/ssh/sshd_config
- sed -i '/SyslogFacility/s/^#//' /etc/ssh/sshd_config
- sed -i '/LogLevel/s/^#//' /etc/ssh/sshd_config
- sed -i '/LoginGraceTime/s/^#//' /etc/ssh/sshd_config
- sed -i '/PermitRootLogin/s/^#//' /etc/ssh/sshd_config
- sed -i '/StrictModes/s/^#//' /etc/ssh/sshd_config
- sed -i '/RSAAuthentication/s/^#//' /etc/ssh/sshd_config
- sed -i '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config
- sed -i '/IgnoreRhosts/s/^#//' /etc/ssh/sshd_config
- sed -i '/PermitEmptyPasswords/s/^#//' /etc/ssh/sshd_config
- sed -i '/X11Forwarding/s/^#//' /etc/ssh/sshd_config
- sed -i '/X11Forwarding/s/no/yes/' /etc/ssh/sshd_config
- sed -i '/X11DisplayOffset/s/^#//' /etc/ssh/sshd_config
- sed -i '/X11UseLocalhost/s/^#//' /etc/ssh/sshd_config
- sed -i '/PrintMotd/s/^#//' /etc/ssh/sshd_config
- sed -i '/PrintMotd/s/yes/no/' /etc/ssh/sshd_config
- sed -i '/PrintLastLog/s/^#//' /etc/ssh/sshd_config
- sed -i '/TCPKeepAlive/s/^#//' /etc/ssh/sshd_config
- sed -i '/the setting of/s/^/#/' /etc/ssh/sshd_config
- sed -i '/RhostsRSAAuthentication and HostbasedAuthentication/s/^/#/' /etc/ssh/sshd_config
- sed -i 's/ListenAddress ::/s/^/#/' /etc/ssh/sshd_config
- #}}}
- #}}}
- print_title "SAMBA - https://wiki.parabolagnulinux.org/index.php/Samba"
- pacman -S --noconfirm samba
- cp /etc/samba/smb.conf.default /etc/samba/smb.conf
- add_new_daemon "@samba"
- print_title "ALSA - https://wiki.parabolagnulinux.org/index.php/Alsa"
- pacman -S --noconfirm alsa-utils alsa-plugins
- sed -i '/MODULES[=]/s/snd-usb-audio//' /etc/rc.conf
- sed -i '/MODULES[=]/s/MODULES[=](/&snd-usb-audio/' /etc/rc.conf
- add_new_daemon "@alsa"
- #}}}
- #X #{{{
- print_title "XORG - https://wiki.parabolagnulinux.org/index.php/Xorg"
- echo "Installing X-Server (req. for Desktopenvironment, GPU Drivers, Keyboardlayout,...)"
- pacman -S --noconfirm xorg-server xorg-xinit xorg-utils xorg-server-utils xorg-xkill xorg-xauth
- pacman -S --noconfirm xf86-input-evdev xf86-input-synaptics
- pacman -S --noconfirm mesa mesa-demos-libre
- pacman -S --noconfirm xorg-twm xorg-xclock xterm
- pacman -S --noconfirm udisks gamin
- #}}}
- #graphic cards #{{{
- print_title "GRAPHIC CARD"
- echo "Select your GPU:"
- echo "[1] Intel"
- echo "[2] ATI"
- echo "[3] Nouveau"
- echo "[4] Virtualbox"
- echo ""
- echo "[q] QUIT"
- echo ""
- read -p "Option: " OPTION
- case "$OPTION" in
- 1)
- pacman -S --noconfirm libgl xf86-video-intel
- install_status
- sumary "Intel GPU driver installation"
- ;;
- 2)
- pacman -S --noconfirm libgl xf86-video-ati ati-dri
- install_status
- sumary "ATI GPU driver installation"
- ;;
- 3)
- pacman -S --noconfirm libgl xf86-video-nouveau nouveau-dri
- modprobe nouveau
- add_new_module "nouveau"
- install_status
- sumary "Nouveau GPU driver installation"
- ;;
- 4)
- pacman -S --noconfirm virtualbox-parabola-additions virtualbox-source
- vboxbuild
- modprobe -a vboxguest vboxsf vboxvideo
- add_new_module "vboxguest vboxsf vboxvideo"
- groupadd vboxsf
- gpasswd -a $USERNAME vboxsf
- install_status
- sumary "Virtualbox guest additions (incl. video drivers) installation"
- ;;
- *)
- CURRENT_STATUS=0
- sumary "GPU drivers installation"
- ;;
- esac
- finish_function
- #}}}
- #desktop environment #{{{
- print_title "DESKTOP ENVIRONMENT - https://wiki.parabolagnulinux.org/index.php/Desktop_Environment"
- echo "Choose your desktop-environment:"
- echo "[1] GNOME"
- echo "[2] KDE"
- echo "[3] XFCE"
- read -p "Option: " OPTION
- case "$OPTION" in
- 1)
- #GNOME #{{{
- print_title "GNOME - https://wiki.parabolagnulinux.org/index.php/GNOME"
- pacman -S --noconfirm gnome gnome-extra
- pacman -S --noconfirm gedit-plugins pulseaudio-gnome gnome-tweak-tool telepathy deja-dup
- pacman -S --noconfirm system-config-printer-gnome
- pacman -S --noconfirm sushi
- pacman -S --noconfirm gksu gvfs-smb xdg-user-dirs
- LOOP=1
- while [ "$LOOP" -ne 0 ]
- do
- print_title "FAVORITE GNOME APPS"
- echo "[1] Openshot"
- echo "[2] Shotwell"
- echo "[3] Guake"
- echo "[4] X-Chat"
- echo "[5] Packagekit"
- echo ""
- echo "[a] ALL"
- echo "[q] QUIT"
- echo ""
- read -p "Option: " OPTION
- case "$OPTION" in
- 1)
- pacman -S --noconfirm openshot
- ;;
- 2)
- pacman -S --noconfirm shotwell
- ;;
- 3)
- pacman -S --noconfirm guake
- ;;
- 4)
- pacman -S --noconfirm xchat
- ;;
- 13)
- pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
- ;;
- "a")
- pacman -S --noconfirm openshot
- pacman -S --noconfirm shotwell
- pacman -S --noconfirm guake
- pacman -S --noconfirm xchat
- pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
- LOOP=0
- ;;
- *)
- LOOP=0
- ;;
- esac
- finish_function
- done
- GNOME=1
- add_new_daemon "gdm"
- sumary "GNOME installation"
- finish_function
- #}}}
- ;;
- 2)
- #KDE #{{{
- print_title "KDE - https://wiki.parabolagnulinux.org/index.php/KDE"
- pacman -S --noconfirm kde kde-l10n-$LOCATION_KDE
- pacman -S --noconfirm kdeadmin-system-config-printer-kde xdg-user-dirs
- LOOP=1
- while [ "$LOOP" -ne 0 ]
- do
- print_title "FAVORITE KDE APPS"
- echo "[4] Choqok"
- echo "[5] K3b"
- echo "[10] Digikam"
- echo "[11] Yakuake"
- echo ""
- echo "[a] ALL"
- echo "[q] QUIT"
- echo ""
- read -p "Option: " OPTION
- case "$OPTION" in
- 4)
- pacman -S --noconfirm choqok
- ;;
- 5)
- pacman -S --noconfirm k3b dvd+rw-tools
- ;;
- 10)
- pacman -S --noconfirm digikam kipi-plugins
- ;;
- 11)
- pacman -S --noconfirm yakuake
- ;;
- "a")
- pacman -S --noconfirm choqok
- pacman -S --noconfirm k3b dvd+rw-tools
- pacman -S --noconfirm digikam kipi-plugins
- pacman -S --noconfirm yakuake
- su -l $USERNAME --command="yaourt -S --noconfirm yakuake-skin-plasma-oxygen-panel"
- LOOP=0
- ;;
- *)
- LOOP=0
- ;;
- esac
- finish_function
- done
- GNOME=0
- add_new_daemon "kdm"
- sumary "KDE installation"
- finish_function
- #}}}
- ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement