diff --git a/install-debian.sh b/install-debian.sh old mode 100755 new mode 100644 index 55fd685..1c6ad7c --- a/install-debian.sh +++ b/install-debian.sh @@ -2,8 +2,10 @@ # functions function repository { - add-apt-repository -y ppa:ultradvorka/ppa - add-apt-repository -y ppa:webupd8team/java + apt-get install -y software-properties-common && ( + add-apt-repository -y ppa:ultradvorka/ppa + add-apt-repository -y ppa:webupd8team/java + ) } function update-upgrade { @@ -13,30 +15,31 @@ function update-upgrade { function common { # default shell - apt-get install -y sudo tmux mc tree pv vim mosh bash-completion + apt-get install -y sudo mc tree pv vim mosh bash-completion # bash shell - apt-get install -y hh - grep HH_CONFIG /etc/bash.bashrc || \ - hh --show-configuration >> /etc/bash.bashrc + apt-get install -y hh && ( + grep HH_CONFIG /etc/bash.bashrc || \ + hh --show-configuration >> /etc/bash.bashrc + ) # zsh shell - apt-get install -y zsh - sed 's/\/bin\/bash/\/bin\/zsh/' /etc/passwd > /tmp/passwd - mv -f /tmp/passwd /etc/passwd - rm -f /tmp/passwd - wget -O /etc/zsh/newuser.zshrc.recommended \ - http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc - root_user=$(grep ':0:' /etc/passwd | awk -F':' '{print $6}') - default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}') - cp -f /etc/zsh/newuser.zshrc.recommended $default_user/.zshrc - cp -f /etc/zsh/newuser.zshrc.recommended $root_user/.zshrc + apt-get install -y zsh && ( + sed -i -- 's/\/bin\/bash/\/bin\/zsh/' /etc/passwd + wget -O /etc/zsh/newuser.zshrc.recommended \ + http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc + root_user=$(grep ':0:' /etc/passwd | awk -F':' '{print $6}') + default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}') + cp -f /etc/zsh/newuser.zshrc.recommended $default_user/.zshrc + cp -f /etc/zsh/newuser.zshrc.recommended $root_user/.zshrc + ) # tmux - echo 'if [ "$TMUX" = "" ]; then tmux; fi' | cat - $default_user/.zshrc > \ - /tmp/.zshrc && mv /tmp/.zshrc $default_user/.zshrc - echo 'if [ "$TMUX" = "" ]; then tmux; fi' | cat - $root_user/.zshrc > \ - /tmp/.zshrc && mv /tmp/.zshrc $root_user/.zshrc + apt-get install -y tmux && ( + default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}') + echo 'if [ "$TMUX" = "" ]; then tmux; fi' | cat - $default_user/.zshrc > \ + /tmp/.zshrc && mv /tmp/.zshrc $default_user/.zshrc + ) # diagnostics apt-get install -y htop iotop iftop nmon powertop stress lm-sensors \ @@ -46,7 +49,7 @@ function common { apt-get install -y git subversion libapache2-svn build-essential # networking - apt-get install -y nfs-common cifs-utils aircrack-ng openvpn axel \ + apt-get install -y nfs-common cifs-utils openvpn axel \ wget ethtool fping # misc. tools @@ -89,8 +92,8 @@ function client-gui { } function client-gui-end { - # Java Plugin - update-alternatives --config mozilla-javaplugin.so + # Java Plugin + update-alternatives --config mozilla-javaplugin.so } function server-gui { @@ -120,8 +123,8 @@ select opt in "${options[@]}" do case $opt in "client-gui") - repository update-upgrade + repository common client-gui common-end @@ -129,16 +132,16 @@ do break ;; "server-cli") - repository update-upgrade + repository common server-cli common-end break ;; "server-gui") - repository update-upgrade + repository common server-gui common-end