#!/bin/bash # # LiHAS Grundinstallation Server Debian 7 Wheezy ln -sf bash /bin/sh #aptitude () { # /usr/bin/aptitude "$@" < /dev/null #} # sources.list bauen cat << EOF > /etc/apt/sources.list #deb http://ftp.de.debian.org/debian-backports wheezy-backports main contrib non-free deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free deb http://ftp.de.debian.org/debian-security/ wheezy/updates main contrib non-free deb http://ftp.de.debian.org/debian wheezy-updates main contrib non-free deb http://ftp.de.debian.org/debian wheezy-proposed-updates main contrib non-free deb http://ftp.lihas.de/debian/ wheezy main deb http://ftp.lihas.de/lihas-kernel/ stable main EOF #Passende Preferences bauen cat << EOF > /etc/apt/preferences Package: * Pin: release a=wheezy-backports Pin-Priority: 200 Package: * Pin: release a=unstable Pin-Priority: 99 Package: * Pin: release a=testing Pin-Priority: 100 Package: * Pin: release a=stable Pin-Priority: 500 Package: * Pin: release a=experimental Pin-Priority: 9 EOF [ ! -s /etc/apt/apt.conf ] && echo "APT::Cache-Limit 267772160;" > /etc/apt/apt.conf wget -O - http://ftp.lihas.de/debian/apt-key-lihas.gpg | apt-key add - aptitude -y update aptitude -y install debsums debconf debconf-utils # nullmailer frueh installieren, damit z.B. nicht exim nachgezogen wird. aptitude -y install nullmailer heirloom-mailx # lihas-keyring aptitude -y install lihas-keyring # damit Key greift aptitude -y update # Debconf-Parameter setzten echo debconf debconf/frontend select Dialog | debconf-set-selections echo debconf debconf/priority select medium | debconf-set-selections echo tzdata tzdata/Areas select Europe | debconf-set-selections echo tzdata tzdata/Zones/Europe select Berlin | debconf-set-selections echo locales locales/default_environment_locale select None | debconf-set-selections echo locales locales/locales_to_be_generated multiselect de_DE ISO-8859-1, de_DE.UTF-8 UTF-8, de_DE@euro ISO-8859-15, en_GB ISO-8859-1, en_GB.ISO-8859-15 ISO-8859-15, en_GB.UTF-8 UTF-8, en_US ISO-8859-1, en_US.ISO-8859-15 ISO-8859-15, en_US.UTF-8 UTF-8 | debconf-set-selections echo man-db man-db/install-setuid boolean false | debconf-set-selections # zusaetzlich zu tzdata echo "Europe/Berlin" > /etc/timezone # zusaetzlich zu locales echo 'LANG="C"' > /etc/default/locale # Basis-Pakete installieren aptitude -y install mdadm lvm2 pciutils ethtool aptitude -y install dialog locales less vim vo screen tzdata ssh psmisc rsyslog ncurses-term bash-completion rsync file logrotate debian-backports-keyring needrestart # vim config cat << EOF >> /etc/vim/vimrc.local syntax on if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif EOF cat << EOF > /etc/locale.gen # This file lists locales that you wish to have built. You can find a list # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change # this file, you need to rerun locale-gen. de_DE ISO-8859-1 de_DE.UTF-8 UTF-8 de_DE@euro ISO-8859-15 en_GB ISO-8859-1 en_GB.ISO-8859-15 ISO-8859-15 en_GB.UTF-8 UTF-8 en_US ISO-8859-1 en_US.ISO-8859-15 ISO-8859-15 en_US.UTF-8 UTF-8 EOF #locale-gen #debconf dpkg-reconfigure -f noninteractive debconf dpkg-reconfigure -f noninteractive tzdata dpkg-reconfigure -f noninteractive locales grep -q /etc/bash_completion /root/.bashrc || echo . /etc/bash_completion >> /root/.bashrc #aptitude -y install modconf # ntp, ntp-simple gibt es nicht mehr(lenny) aptitude -y install ntp ntpdate # vserver #aptitude -y install grub2 linux-image-3.10-vserver-amd64 bridge-utils drbd8-utils firmware-bnx2 util-vserver # Zum Schluss nano weg und dist-upgrade aptitude -y purge nano aptitude -y dist-upgrade # vim zum default-Editor machen update-alternatives --set editor /usr/bin/vim.basic # git silencen ( if dpkg -l etckeeper > /dev/null ; then cd /etc git config --global user.name root git config --global user.email support@lihas.de git commit --amend --reset-author -m "things done" fi ) # remove dangeling symlink if [ -L /etc/resolv.conf ] && [ ! dpkg -l resolvconf > /dev/null ] ; then rm /etc/resolv.conf echo "" > /etc/resolv.conf echo "******* /etc/resolv.conf is EMPTY ********" fi # clean up packet cache apt-get clean X=`grep -n ^[^#]*allow-hotplug /etc/network/interfaces | sed 's/^/ /g'` [ -n "$X" ] && cat << EOF ********************************************************** please remove "allow-hotplug" from /etc/network/interfaces $X use "auto" instead ********************************************************** EOF # cciss ueberwachen #aptitude -y install cciss-vol-status # ipmi #aptitude -y install ipmitool # heartbeat