#!/bin/bash # # LiHAS Grundinstallation Wheezy Vserver ln -sf bash /bin/sh rm /var/lib/apt/lists/* -vf grep -ri 'APT::Cache-Limit' /etc/apt/* [ $? != 0 ] && cat << EOF >> /etc/apt/apt.conf.d/70debconf APT::Cache-Limit "100000000"; EOF apt-get clean # In case of distupgrade #apt-get -y update #apt-get -y --force-yes upgrade #apt-get -y --force-yes dist-upgrade #apt-get -y --force-yes upgrade cat << EOF > /etc/apt/sources.list deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free deb http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free #deb http://ftp.de.debian.org/debian/ jessie main contrib non-free #deb http://ftp.de.debian.org/debian/ wheezy-proposed-updates 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-backports main contrib non-free deb http://ftp.lihas.de/debian/ wheezy main EOF cat << EOF > /etc/apt/preferences Package: * Pin: release a=wheezy-backports Pin-Priority: 200 Package: * Pin: release n=wheezy-proposed-updates Pin-Priority: 510 Package: * Pin: release n=wheezy-updates Pin-Priority: 510 Package: * Pin: release n=sid Pin-Priority: 99 Package: * Pin: release n=jessie Pin-Priority: 100 Package: * Pin: release n=wheezy Pin-Priority: 510 Package: * Pin: release a=experimental Pin-Priority: 9 EOF wget -O - http://ftp.lihas.de/debian/apt-key-lihas.gpg | apt-key add - apt-get -y update # Debconf-Parameter setzen echo debconf debconf/frontend select Dialog | debconf-set-selections echo debconf debconf/priority select medium | debconf-set-selections echo nullmailer nullmailer/defaultdomain string | debconf-set-selections echo nullmailer shared/mailname string mail | debconf-set-selections echo nullmailer nullmailer/adminaddr string | debconf-set-selections echo nullmailer nullmailer/relayhost string mail | debconf-set-selections echo man-db man-db/auto-update boolean true | debconf-set-selections echo man-db man-db/install-setuid boolean false | debconf-set-selections echo ca-certificates ca-certificates/new_crts multiselect | debconf-set-selections echo ca-certificates ca-certificates/trust_new_crts select yes | 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_US ISO-8859-1, en_US.ISO-8859-15 ISO-8859-15, en_US.UTF-8 UTF-8 | debconf-set-selections # zusaetzlich zu tzdata echo "Europe/Berlin" > /etc/timezone # nullmailer, damit nicht exim nachgezogen wird, z.B. bei rsnapshot apt-get -y install nullmailer heirloom-mailx # zusaetzlich zu locales echo 'LANG=de_DE.UTF-8' > /etc/default/locale 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_US ISO-8859-1 en_US.ISO-8859-15 ISO-8859-15 en_US.UTF-8 UTF-8 EOF #cat /etc/locale.gen apt-get -y install debsums debconf-utils locales screen bash-completion grep -q /etc/bash_completion /root/.bashrc || echo . /etc/bash_completion >> /root/.bashrc # lihas-keyring apt-get -y --force-yes install lihas-keyring vo # damit Key greift apt-get -y update apt-get -y --force-yes install dialog less vim screen tzdata debconf ssh psmisc ncurses-term rsyslog mktemp file debian-keyring logrotate rsync etckeeper #apt-get -y install debian-backports-keyring #locale-gen dpkg-reconfigure -f noninteractive debconf dpkg-reconfigure -f noninteractive tzdata dpkg-reconfigure -f noninteractive locales # vim config [ ! -f /etc/vim/vimrc.local ] && cat << EOF > /etc/vim/vimrc.local syntax on if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif EOF apt-get -y purge nano ifupdown apt-get -y dist-upgrade # rsyslog anpassen sed '/imklog/s/^/#/' < /etc/rsyslog.conf > /etc/rsyslog.conf.new ; mv /etc/rsyslog.conf.new /etc/rsyslog.conf # Bei dist-upgrade, falls apache vorhanden # ulimit warnung/cronmail bei logrotate if [ -f /etc/apache2/envvars ] then sed -i 's/.*APACHE_ULIMIT_MAX_FILES.*/APACHE_ULIMIT_MAX_FILES=true/' /etc/apache2/envvars service apache2 reload fi # stoerende Dienste deaktivieren, pakete entfernen [ -f /etc/init.d/hwclock.sh ] && update-rc.d hwclock.sh stop 99 0 1 2 3 4 5 6 S . [ -f /etc/init.d/checkfs.sh ] && update-rc.d checkfs.sh stop 99 0 1 2 3 4 5 6 S . apt-get -y purge iptables kmod [ ! -e /dev/fd ] && ln -s /proc/self/fd /dev/fd # auf db2.printacon hat wheezy-installation /var/lock gefehlt: [ ! -e /var/lock ] && ln -s /run/lock /var/lock # da bei wheezyVS auf wheezyHost die rc-Symlinks untergehen: apt-get --reinstall install cron # 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 # replace static /etc/mtab rm /etc/mtab ; ln -s /proc/mounts /etc/mtab # clean up packet cache apt-get clean apt-get autoremove