]> piware.de Git - bin.git/blob - postinst-setup
postinst-setup updates
[bin.git] / postinst-setup
1 #!/bin/sh -e
2
3 # need bzr and postfix for the setup below
4 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko apt-cacher-ng eatmydata
5
6 # root's ssh stuff
7 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
8     mkdir -p /root/.ssh
9     chmod 700 /root/.ssh
10     cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
11 fi
12
13 # restore /etc bzr branch, rescue the files we do not want to restore
14 # completely
15 cd /etc
16 if [ ! -d /etc/.bzr ]; then
17     [ -e /backup-etc ] || bzr branch bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
18     cp -av /backup-etc/* /etc/
19     cp -av /backup-etc/.bzr/ /etc/
20     rm -rf /backup-etc
21     chmod 600 /etc/ssh/ssh_*_key
22     chmod 700 /etc/ssl/private
23     chmod 640 /etc/ssl/private/ssl-cert-*
24     chown root:ssl-cert /etc/ssl/private/ssl-cert*
25     echo "none /tmp tmpfs defaults 0 0" >> /etc/fstab
26 fi
27
28 # update postfix for new configuration
29 newaliases
30 /etc/init.d/postfix restart
31
32 # remove packages that we do not need
33 killall apt-get || true # cronjob goo
34 apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird deja-dup || true
35
36 # install packages from network sources
37 killall apt-get || true
38 apt-get update
39
40 DEBIAN_FRONTEND=noninteractive eatmydata apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts python-notify2 listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet wmctrl libnotify-bin svn-buildpackage pastebinit lptools openvpn pdfjam sbuild schroot exiv2 gstreamer1.0-plugins-ugly gstreamer1.0-libav flashplugin-installer valgrind calibre autopkgtest
41 eatmydata apt-get install -y lxc pandoc lmodern texlive-fonts-recommended pep8 pyflakes pssh network-manager-openvpn-gnome
42
43 # have schroot use tmpfs
44 rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/
45 ln -s /tmp /var/lib/schroot/unpack
46 ln -s /tmp /var/lib/schroot/union/overlay
47
48 # set up users
49 echo "Setting up users"
50 adduser martin sbuild
51 if ! getent passwd joe > /dev/null; then
52     adduser --gecos "Joe" --encrypt-home joe
53     adduser joe audio
54     adduser joe video
55 fi
56
57 # crontabs
58 crontab -u martin - <<EOF
59 # m h  dom mon dow   command
60 05 * * * * \$HOME/bin/backup >/dev/null
61 EOF