]> piware.de Git - bin.git/blob - postinst-setup
retry-gh-systemd-test: xenial -> artful
[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 install -y linux-signed-image-generic
35 apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird deja-dup gnome-screensaver linux-headers-generic linux-generic || true
36
37 # install packages from network sources
38 killall apt-get || true
39 apt-get update
40
41 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 git-buildpackage d-feet libnotify-bin pastebinit lptools openvpn pdfjam sbuild schroot exiv2 gstreamer1.0-plugins-ugly gstreamer1.0-libav valgrind calibre autopkgtest
42 eatmydata apt-get install -y lxc lxd pandoc lmodern texlive-fonts-recommended pep8 pyflakes pssh network-manager-openvpn-gnome i3-wm i3status
43
44 # have schroot use tmpfs
45 rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/
46 ln -s /tmp /var/lib/schroot/unpack
47 ln -s /tmp /var/lib/schroot/union/overlay
48
49 # set up users
50 echo "Setting up users"
51 adduser martin sbuild
52 if ! getent passwd joe > /dev/null; then
53     adduser --gecos "Joe" --encrypt-home joe
54     adduser joe audio
55     adduser joe video
56 fi
57
58 # crontabs
59 crontab -u martin - <<EOF
60 # m h  dom mon dow   command
61 05 * * * * \$HOME/bin/backup >/dev/null
62 EOF