#!/bin/sh -e # move backup to /var if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then cp -a /home/martin/backup /var/backups/martin rm -rf /home/martin/backup fi # need bzr and postfix for the setup below DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko apt-cacher-ng # root's ssh stuff if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then mkdir -p /root/.ssh chmod 700 /root/.ssh cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/ fi # restore /etc bzr branch, rescue the files we do not want to restore # completely cd /etc if [ ! -d /etc/.bzr ]; then [ -e /backup-etc ] || bzr branch bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc cp -av /backup-etc/* /etc/ cp -av /backup-etc/.bzr/ /etc/ rm -rf /backup-etc chmod 600 /etc/ssh/ssh_*_key chmod 700 /etc/ssl/private chmod 640 /etc/ssl/private/ssl-cert-* chown root:ssl-cert /etc/ssl/private/ssl-cert* echo "none /tmp tmpfs defaults 0 0" >> /etc/fstab fi # update postfix for new configuration newaliases /etc/init.d/postfix restart # remove packages that we do not need killall apt-get || true # cronjob goo apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird || true # install packages from network sources killall apt-get || true apt-get update DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog libtool devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts wdiff ccache listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag rsnapshot texlive-lang-german texlive-latex-extra powertop qemu-kvm bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet debootstrap wmctrl mumble libnotify-bin svn-buildpackage pastebinit lptools openvpn pdfjam sbuild schroot apt-get -y --no-install-recommends build-dep postgresql-9.1 apport calibre gvfs udisks2 upower gnome-disk-utility systemd pygobject # have schroot use tmpfs rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/ ln -s /tmp /var/lib/schroot/unpack ln -s /tmp /var/lib/schroot/union/overlay # set up users echo "Setting up users" adduser martin sbuild if ! getent passwd joe > /dev/null; then adduser --gecos "Joe" joe adduser joe audio adduser joe video fi # crontabs crontab -u martin - </dev/null EOF