Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ~/.bin/setup
- # run as root on a fresh system to install base and gui packages and create user
- echo -n "Is your network up and running? (y/n) "
- if read -q; then
- echo "Good. Proceeding."
- else
- echo "You'll need internet access."
- echo "Please configure your network before calling this script again."
- return 0
- fi
- echo -n "Did you configure pacman.conf to include [archlinuxfr]? "
- if read -q; then
- echo "Good. Proceeding."
- else
- echo "Don't worry. I'll do it for you."
- echo " " >> /etc/pacman.conf
- echo "[archlinuxfr]" >> /etc/pacman.conf
- if [[ `uname --machine` = i686 ]];then
- echo "Server = http://repo.archlinux.fr/i686" >> /etc/pacman.conf
- echo "Your pacman.conf is now updated to include the 32bit repository of archlinuxfr."
- elif [[ `uname --machine` = x86_64 ]];then
- echo "Server = http://repo.archlinux.fr/x86_64" >> /etc/pacman.conf
- echo "Your pacman.conf is now updated to include the 64bit repository of archlinuxfr."
- else
- echo "Sorry, but i can't read the system architecture."
- echo "Please configure pacman.conf manually."
- echo "Exiting now."
- return 0
- fi
- fi
- echo -n "Are you using a fast and up-to-date mirror? "
- if read -q; then
- echo "Good. Proceeding."
- echo -n "Did you sync the mirrorlist yet? "
- read answer
- case "$answer" in
- yes|y|'') echo "Good. Proceeding."
- ;;
- no|n) echo "Okay. Let's do it now."
- pacman -Syy
- echo "Done. Proceeding with setup."
- ;;
- esac
- else
- echo "NP. Doing it for you. I may need input though."
- echo "Checking if reflector is installed."
- if [[ $(pacman -Qsl | grep -c reflector) = 0 ]];then
- echo "Not installed. Downloading reflector."
- pacman -Sy reflector
- else
- echo "Good. Reflector is installed."
- fi
- echo "Updating your mirrorlist now."
- reflector -l 8 -r -o /etc/pacman.d/mirrorlist
- pacman -Syy
- echo "Your mirrorlist should now be updated."
- echo "Proceeding."
- fi
- echo -n "Download and install Base and GUI now? (base/both/none) "
- read answer
- case "$answer" in
- both) echo "Both basic system and gui packages will now be installed and downloaded."
- echo "No input needed for the next ~30 minutes. Go do some work."
- pacman -S alsa-utils acpid pm-utils cpufrequtils nfs-utils rpcbind rsync tree \
- calc bc dosfstools ntfsprogs abs cups pmount samba openssh ntfs-3g \
- autojump ethtool lm_sensors stress reflector yaourt \
- lzop unzip rar p7zip unrar zip xz-utils unace xclip xsel \
- ncmpc smartmontools beep zsh grc cowsay fortune-mod vim htop screen \
- irssi wgetpaste scrot curl clamav powertop laptop-mode-tools slock \
- mpc moc imagemagick wol aumix-gtk mlocate \
- xorg xf86-input-evdev xf86-video-intel \
- openbox openbox-themes obconf obmenu tint2 \
- gamin transset-df gxmessage xdg-user-dirs xcompmgr \
- ttf-dejavu ttf-ms-fonts ttf-bitstream-vera \
- terminal galculator gvim feh gmrun medit xarchiver epdfview \
- mirage conky sonata gmpc firefox thunderbird flashplugin vlc
- echo "Delete libxft and cairo to replace them with lcd packages later on."
- pacman -Rd libxft cairo
- echo "Some more packages from the AUR."
- yaourt -S fortune-mod-tbbt fortune-mod-montypython fortune-mod-himym \
- fortune-mod-chucknorris zsh-lovers sleepd-git \
- fontconfig-lcd cairo-lcd pcmanfm-git clyde-git diffuse \
- aurvote firebrand thunderbrand abiword-light stiler
- pacman -S libxft-lcd
- ;;
- base) echo "Only basic system packages will now be downloaded and installed."
- echo "Downloading basic packages"
- pacman -S alsa-utils acpid pm-utils cpufrequtils nfs-utils rpcbind rsync tree \
- calc bc dosfstools ntfsprogs abs cups pmount samba openssh ntfs-3g \
- autojump ethtool lm_sensors stress reflector yaourt \
- lzop unzip rar p7zip unrar zip xz-utils unace xclip xsel \
- ncmpc smartmontools beep zsh grc cowsay fortune-mod vim htop screen \
- irssi wgetpaste scrot curl clamav powertop laptop-mode-tools slock \
- mpc moc imagemagick wol aumix-gtk mlocate
- echo "Some fun stuff from the AUR."
- yaourt -S --aur fortune-mod-tbbt fortune-mod-montypython fortune-mod-himym \
- fortune-mod-chucknorris zsh-lovers sleepd-git clyde-git
- ;;
- none) echo "Skipping download and installation."
- ;;
- esac
- echo -n "Setup User now? "
- if read -q; then
- echo "Preparing to create user."
- echo -n "Setup demian or slave? "
- read answer
- case "$answer" in
- demian|d|1) echo "Proceeding for demian."
- echo "Creating user demian, his password and some directories."
- useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/zsh demian
- echo "Please specify a password:"
- passwd demian
- echo "Creating directories in /media:"
- mkdir -v /media/share /media/daten
- echo "Downloading some last packages:"
- pacman -Sy yaourt
- yaourt -S tp_smapi phc-intel netcfg wpa_actiond ifplugd slim
- echo "System is installed and ready to configure."
- ;;
- slave|s|2) echo "Proceeding for slave."
- echo "Creating user slave, his password and some directories"
- useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/zsh slave
- echo "Please specify a password:"
- passwd slave
- echo "Creating directories in /media:"
- mkdir -v /media/movies /media/music /media/series /media/share /media/usbhdd
- echo "Downloading some last packages:"
- pacman -Sy lighttpd fcgi php php-cgi mpd rtorrent yaourt
- yaourt -S phc-intel eaccelerator
- echo "System is installed and ready to configure."
- ;;
- esac
- else
- echo "Skipping user creation. Setup is done."
- fi
Advertisement
Add Comment
Please, Sign In to add comment