This commit is contained in:
Gero Müller 2016-03-18 22:31:16 +01:00
parent f65ec91dfb
commit 5f513383f3

View File

@ -6,7 +6,7 @@ set -e
echo "Setup best practice default repositories, see http://httpredir.debian.org/" echo "Setup best practice default repositories, see http://httpredir.debian.org/"
tee /etc/apt/sources.list <<EOF cat > /etc/apt/sources.list <<EOF
deb http://httpredir.debian.org/debian jessie main contrib deb http://httpredir.debian.org/debian jessie main contrib
deb http://httpredir.debian.org/debian jessie-updates main contrib deb http://httpredir.debian.org/debian jessie-updates main contrib
deb http://httpredir.debian.org/debian jessie-backports main contrib deb http://httpredir.debian.org/debian jessie-backports main contrib
@ -20,34 +20,37 @@ apt install -y htop ne iotop curl wget zsh figlet iptraf
echo "Use zsh!" echo "Use zsh!"
wget -O /root/.zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc wget -q -O /root/.zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
tee -a /root/.zshrc << EOF cat >>/root/.zshrc << EOF
export LS_COLORS="*=00;37:rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:" export LS_COLORS="*=00;37:rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:"
RED="$(tput setaf 1)" RED="$(tput setaf 1)"
ORANGE="$(tput setaf 3)" ORANGE="$(tput setaf 3)"
BLUE="$(tput setaf 4)" BLUE="$(tput setaf 4)"
BLACK="$(tput sgr0)" BLACK="$(tput sgr0)"
colorls() { colorls() {
/bin/ls -lh --color=yes $@ | sed -e "s/ \([0-9,.]\+K\) / ${BLUE}\1${BLACK} /g" -e "s/ \([0-9.,]\+G\) / ${RED}\1${BLACK} /g" -e "s/ \([0-9.,]\+M\) / ${ORANGE}\1${BLACK} /g" /bin/ls -lh --color=yes $@ | sed -e "s/ \([0-9,.]\+K\) / ${BLUE}\1${BLACK} /g" -e "s/ \([0-9.,]\+G\) / ${RED}\1${BLACK} /g" -e "s/ \([0-9.,]\+M\) / ${ORANGE}\1${BLACK} /g"
} }
alias ls='/bin/ls -h --color=auto' alias ls='command ls -h --color=auto'
alias l='colorls' alias l='colorls'
alias ll='colorls -A' alias ll='colorls -A'
EOF EOF
chsh -s /bin/zsh chsh -s /bin/zsh
echo "Setup hostname." echo "Setup hostname."
( exec ne /etc/hostname /etc/hosts ) ( exec ne /etc/hostname /etc/hosts )
hostname -F /etc/hostname hostname -F /etc/hostname
echo "Nice motd." echo "Nice motd."
figlet `hostname -f | sed 's/\./ \. /'` > /etc/motd figlet `hostname -f | sed 's/\./ \. /g'` > /etc/motd
echo "Install system and security utils." echo "Install system and security utils."
apt install -y systemd-cron apticron ssmtp logwatch apt install -y systemd-cron apticron ssmtp logwatch
( exec ne /etc/ssmtp/* ) ( exec ne /etc/ssmtp/* )
echo "Disable unneeded getty" echo "Disable unneeded getty"
for i in {4..6}; do for i in {4..6}; do
systemctl stop getty@tty$i.service systemctl stop getty@tty$i.service
@ -55,3 +58,4 @@ for i in {4..6}; do
done done
} }