some changes
This commit is contained in:
parent
edccabe7f0
commit
275f75b561
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# functions
|
||||||
function repository {
|
function repository {
|
||||||
add-apt-repository -y ppa:ultradvorka/ppa
|
add-apt-repository -y ppa:ultradvorka/ppa
|
||||||
add-apt-repository -y ppa:webupd8team/java
|
add-apt-repository -y ppa:webupd8team/java
|
||||||
@ -12,41 +13,79 @@ function update-upgrade {
|
|||||||
|
|
||||||
function common {
|
function common {
|
||||||
# default shell
|
# default shell
|
||||||
apt-get install -y sudo tmux mc tree pv vim mosh
|
apt-get install -y sudo tmux mc tree pv vim mosh bash-completion
|
||||||
# shell
|
|
||||||
apt-get install -y hh zsh
|
# bash shell
|
||||||
grep HH_CONFIG /etc/bash.bashrc || hh --show-configuration >> /etc/bash.bashrc
|
apt-get install -y hh
|
||||||
sed 's/\/bin\/bash/\/bin\/zsh/' /etc/passwd > /etc/passwd.new
|
grep HH_CONFIG /etc/bash.bashrc || \
|
||||||
mv /etc/passwd.new /etc/passwd
|
hh --show-configuration >> /etc/bash.bashrc
|
||||||
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
|
# 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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
# diagnostics
|
# diagnostics
|
||||||
apt-get install -y htop iotop iftop nmon powertop stress lm-sensors
|
apt-get install -y htop iotop iftop nmon powertop stress lm-sensors \
|
||||||
# versioning
|
gddrescue smartmontools kpartx
|
||||||
apt-get install -y git git-gui subversion libapache2-svn
|
|
||||||
|
# programming
|
||||||
|
apt-get install -y git subversion libapache2-svn build-essential
|
||||||
|
|
||||||
# networking
|
# networking
|
||||||
apt-get install -y nfs-common cifs-utils aircrack-ng openvpn axel wget ethtool mii-tool
|
apt-get install -y nfs-common cifs-utils aircrack-ng openvpn axel \
|
||||||
|
wget ethtool fping
|
||||||
|
|
||||||
|
# misc. tools
|
||||||
|
apt-get install -y apt-file aptitude hexedit manpages-de
|
||||||
}
|
}
|
||||||
|
|
||||||
function common-end {
|
function common-end {
|
||||||
# configure system
|
# configure system
|
||||||
apt-get install -y console-data keyboard-configuration manpages-de
|
apt-get install -y console-data console-setup locales \
|
||||||
|
keyboard-configuration tzdata
|
||||||
|
dpkg-reconfigure console-data console-setup locales \
|
||||||
|
keyboard-configuration tzdata
|
||||||
|
|
||||||
|
# run programs
|
||||||
|
apt-file update
|
||||||
sensors-detect
|
sensors-detect
|
||||||
}
|
}
|
||||||
|
|
||||||
function client-gui {
|
function client-gui {
|
||||||
# programs
|
# programs
|
||||||
apt-get install -y firefox firefox-locale-de thunderbird thunderbird-locale-de \
|
apt-get install -y firefox firefox-locale-de thunderbird \
|
||||||
keepassx filezilla vlc gparted wireshark kate
|
thunderbird-locale-de keepassx filezilla vlc gparted \
|
||||||
|
wireshark kate
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
apt-get install -y eclipse
|
apt-get install -y eclipse
|
||||||
|
|
||||||
# OpenJDK
|
# OpenJDK
|
||||||
apt-get install -y openjdk-6-jdk openjdk-6-source openjdk-6-demo openjdk-6-doc \
|
apt-get install -y openjdk-6-jdk openjdk-6-source openjdk-6-demo \
|
||||||
openjdk-6-jre-headless openjdk-6-jre-lib
|
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 \
|
apt-get install -y openjdk-7-jdk openjdk-7-source openjdk-7-demo \
|
||||||
openjdk-7-jre-headless openjdk-7-jre-lib
|
openjdk-7-doc openjdk-7-jre-headless openjdk-7-jre-lib
|
||||||
|
apt-get install -y icedtea-7-plugin
|
||||||
|
|
||||||
# Oracle Java
|
# Oracle Java
|
||||||
apt-get install -y oracle-java7-installer oracle-java8-installer
|
apt-get install -y oracle-java7-installer oracle-java8-installer
|
||||||
|
|
||||||
|
# misc. tools
|
||||||
|
apt-get install -y git-gui bless
|
||||||
}
|
}
|
||||||
|
|
||||||
function client-gui-end {
|
function client-gui-end {
|
||||||
@ -56,8 +95,9 @@ function client-gui-end {
|
|||||||
|
|
||||||
function server-gui {
|
function server-gui {
|
||||||
# programs
|
# programs
|
||||||
apt-get install -y firefox firefox-locale-de thunderbird thunderbird-locale-de \
|
apt-get install -y firefox firefox-locale-de thunderbird \
|
||||||
filezilla gparted wireshark kate
|
thunderbird-locale-de filezilla gparted wireshark kate
|
||||||
|
|
||||||
# ssh
|
# ssh
|
||||||
apt-get install -y openssh-server
|
apt-get install -y openssh-server
|
||||||
}
|
}
|
||||||
@ -67,13 +107,15 @@ function server-cli {
|
|||||||
apt-get install -y openssh-server
|
apt-get install -y openssh-server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if root
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root" 1>&2
|
echo "This script must be run as root" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# choose plattform
|
||||||
PS3='Please enter your system '
|
PS3='Please enter your system '
|
||||||
options=("client-gui" "server-cli" "server-gui" "Quit")
|
options=("client-gui" "server-cli" "server-gui" "quit")
|
||||||
select opt in "${options[@]}"
|
select opt in "${options[@]}"
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
@ -102,6 +144,8 @@ do
|
|||||||
common-end
|
common-end
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*) echo invalid option;;
|
*)
|
||||||
|
echo invalid option
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user