From dd8b5fa275957b33df8f034724b36339475ae8e0 Mon Sep 17 00:00:00 2001 From: Andreas Fendt Date: Fri, 5 Sep 2014 21:41:50 +0200 Subject: [PATCH] Major improvements Signed-off-by: Andreas Fendt --- README | 1 + install-debian-server.sh | 67 ------------------ install-debian.sh | 148 +++++++++++++++++++++++---------------- 3 files changed, 90 insertions(+), 126 deletions(-) delete mode 100644 install-debian-server.sh mode change 100644 => 100755 install-debian.sh diff --git a/README b/README index e69de29..bb910a9 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +Installscript for Linux diff --git a/install-debian-server.sh b/install-debian-server.sh deleted file mode 100644 index d01133c..0000000 --- a/install-debian-server.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -# Update System -apt-get update -y -apt-get upgrade -y - -# Configure System -apt-get install -y console-data keyboard-configuration manpages-de - -# Programs -apt-get install -y firefox firefox-locale-de \ - thunderbird thunderbird-locale-de \ - keepassx \ - filezilla \ - vlc \ - gparted \ - wireshark - -# Default Shell -apt-get install -y sudo tmux mc tree pv vim - -# History Shell -add-apt-repository ppa:ultradvorka/ppa -apt-get update -apt-get install -y hh - -# Zsh Shell -apt-get install -y zsh - -# Update Shell Configuration -hh --show-configuration >> /root/.bashrc -find /home -name .bashrc | \ -while read path -do - hh --show-configuration >> $path - wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc -done - -# Diagnostics -apt-get install -y htop iotop iftop nmon powertop stress lm-sensors -sensors-detect - -# Misc. -apt-get install -y git - -# Networking -apt-get install -y nfs-common \ - cifs-utils \ - aircrack-ng \ - openvpn \ - openssh-server - -# OpenJDK -apt-get install -y openjdk-7-jdk openjdk-7-source openjdk-7-demo openjdk-7-doc openjdk-7-jre-headless openjdk-7-jre-lib -apt-get install -y openjdk-6-jdk openjdk-6-source openjdk-6-demo openjdk-6-doc openjdk-6-jre-headless openjdk-6-jre-lib - -# Oracle Java -add-apt-repository ppa:webupd8team/java -apt-get update -apt-get install -y oracle-java7-installer \ - oracle-java8-installer - -# Java Plugin -update-alternatives --config mozilla-javaplugin.so - -# IDE -apt-get install -y eclipse diff --git a/install-debian.sh b/install-debian.sh old mode 100644 new mode 100755 index d01133c..9009717 --- a/install-debian.sh +++ b/install-debian.sh @@ -1,67 +1,97 @@ -#!/bin/sh +#!/bin/bash -# Update System -apt-get update -y -apt-get upgrade -y +function repository { + add-apt-repository -y ppa:ultradvorka/ppa + add-apt-repository -y ppa:webupd8team/java +} -# Configure System -apt-get install -y console-data keyboard-configuration manpages-de +function update-upgrade { + apt-get update -y + apt-get upgrade -y +} -# Programs -apt-get install -y firefox firefox-locale-de \ - thunderbird thunderbird-locale-de \ - keepassx \ - filezilla \ - vlc \ - gparted \ - wireshark +function common { + # configure system + apt-get install -y console-data keyboard-configuration manpages-de + # default shell + apt-get install -y sudo tmux mc tree pv vim mosh + # shell + apt-get install -y hh zsh + grep HH_CONFIG /etc/bash.bashrc || hh --show-configuration >> /etc/bash.bashrc + sed 's/\/bin\/bash/\/bin\/zsh/' /etc/passwd > /etc/passwd.new + mv /etc/passwd.new /etc/passwd + wget -O /etc/zsh/newuser.zshrc.recommended http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc + cp /etc/zsh/newuser.zshrc.recommended /root/.zshrc + # diagnostics + apt-get install -y htop iotop iftop nmon powertop stress lm-sensors + sensors-detect + # versioning + apt-get install -y git git-gui subversion libapache2-svn + # networking + apt-get install -y nfs-common cifs-utils aircrack-ng openvpn +} -# Default Shell -apt-get install -y sudo tmux mc tree pv vim +function client-gui { + # programs + apt-get install -y firefox firefox-locale-de thunderbird thunderbird-locale-de \ + keepassx filezilla vlc gparted wireshark + # IDE + apt-get install -y eclipse + # OpenJDK + apt-get install -y openjdk-6-jdk openjdk-6-source openjdk-6-demo openjdk-6-doc \ + openjdk-6-jre-headless openjdk-6-jre-lib + apt-get install -y openjdk-7-jdk openjdk-7-source openjdk-7-demo openjdk-7-doc \ + openjdk-7-jre-headless openjdk-7-jre-lib + # Oracle Java + apt-get install -y oracle-java7-installer oracle-java8-installer + # Java Plugin + update-alternatives --config mozilla-javaplugin.so +} -# History Shell -add-apt-repository ppa:ultradvorka/ppa -apt-get update -apt-get install -y hh +function server-gui { + # programs + apt-get install -y firefox firefox-locale-de thunderbird thunderbird-locale-de \ + keepassx filezilla vlc gparted wireshark + # ssh + apt-get install -y openssh-server +} -# Zsh Shell -apt-get install -y zsh +function server-cli { + # ssh + apt-get install -y openssh-server +} -# Update Shell Configuration -hh --show-configuration >> /root/.bashrc -find /home -name .bashrc | \ -while read path +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +PS3='Please enter your system ' +options=("client-gui" "server-cli" "server-gui" "Quit") +select opt in "${options[@]}" do - hh --show-configuration >> $path - wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc -done - -# Diagnostics -apt-get install -y htop iotop iftop nmon powertop stress lm-sensors -sensors-detect - -# Misc. -apt-get install -y git - -# Networking -apt-get install -y nfs-common \ - cifs-utils \ - aircrack-ng \ - openvpn \ - openssh-server - -# OpenJDK -apt-get install -y openjdk-7-jdk openjdk-7-source openjdk-7-demo openjdk-7-doc openjdk-7-jre-headless openjdk-7-jre-lib -apt-get install -y openjdk-6-jdk openjdk-6-source openjdk-6-demo openjdk-6-doc openjdk-6-jre-headless openjdk-6-jre-lib - -# Oracle Java -add-apt-repository ppa:webupd8team/java -apt-get update -apt-get install -y oracle-java7-installer \ - oracle-java8-installer - -# Java Plugin -update-alternatives --config mozilla-javaplugin.so - -# IDE -apt-get install -y eclipse + case $opt in + "client-gui") + repository + update-upgrade + common + client-gui + break + ;; + "server-cli") + repository + update-upgrade + common + server-cli + break + ;; + "server-gui") + repository + update-upgrade + common + server-gui + break + ;; + *) echo invalid option;; + esac +done \ No newline at end of file