#!/bin/bash # # LiHAS Grundinstallation Server Ubuntu 16.4 ln -sf bash /bin/sh #aptitude () { # /usr/bin/aptitude "$@" < /dev/null #} # sources.lists bauen cat << EOF > /etc/apt/sources.list.d/lihas.de.list deb http://ftp.lihas.de/debian/ wheezy main EOF #cat << EOF > /etc/apt/sources.list.d/kernel.lihas.de.list #deb http://ftp.lihas.de/lihas-kernel/ stable main #EOF # #cat << EOF > /etc/apt/sources.list.d/repo.fischglas.de #deb http://repo.fischglas.de/debian/ wheezy 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 - apt -y update apt -y install debsums debconf debconf-utils # nullmailer frueh installieren, damit z.B. nicht exim nachgezogen wird. apt -y install nullmailer heirloom-mailx # lihas-keyring apt -y install --allow-unauthenticated lihas-keyring # damit Key greift apt -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 de_DE.UTF-8 | 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 apt -y install mdadm lvm2 pciutils ethtool apt -y install --allow-unauthenticated vo apt -y install dialog locales less vim screen tzdata ssh psmisc rsyslog ncurses-term bash-completion rsync file logrotate 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) apt -y install ntp ntpdate # vserver #apt -y install grub2 linux-image-3.10-vserver-amd64 bridge-utils drbd8-utils firmware-bnx2 util-vserver # Zum Schluss nano weg und dist-upgrade apt -y purge nano apt -y dist-upgrade # vim zum default-Editor machen update-alternatives --set editor /usr/bin/vim.basic # etckeeper installieren & git silencen apt -y install etckeeper ( 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