4 if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then
5 cp -a /home/martin/backup /var/backups/martin
6 rm -rf /home/martin/backup
9 # need bzr and postfix for the setup below
10 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko
13 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
16 cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
19 # restore /etc bzr branch, rescue the files we do not want to restore
22 if [ ! -d /etc/.bzr ]; then
23 #for i in passwd group shadow fstab; do
25 [ -e $i.originst ] || cp $i $i.originst
27 [ -e /backup-etc ] || bzr get bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
28 cp -av /backup-etc/* /etc/
29 cp -av /backup-etc/.bzr/ /etc/
31 chmod 600 /etc/ssh/ssh_*_key
32 #chmod 640 /etc/shadow
33 #chown root:shadow /etc/shadow
34 chmod 700 /etc/ssl/private
35 chmod 640 /etc/ssl/private/ssl-cert-*
36 chown root:ssl-cert /etc/ssl/private/ssl-cert*
38 # only restore dchroot part into fstab
39 grep -A 200 "^#.*chroot" fstab >> fstab.originst || true
40 mv fstab.originst fstab
42 # only restore the human users from passwd/group
43 #for i in passwd group; do
44 # perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst
48 # only restore some passwords from shadow
49 #egrep 'martin|netti|joe' shadow >> shadow.originst
50 #mv shadow.originst shadow
51 #chown root:shadow shadow
55 # update postfix for new configuration
57 /etc/init.d/postfix restart
60 dpkg -i /home/martin/download/libdvdcss2_*deb || true
61 locale-gen ru_RU ru_RU.UTF-8
63 # remove packages that we do not need
64 killall apt-get || true # cronjob goo
65 apt-get purge -y --auto-remove hplip brltty bluez-cups gnome-accessibility-themes gnome-mag gnome-orca onboard tomboy ttf-lao ttf-thai-tlwg || true
67 rm -f /etc/rcS.d/*pcmcia* /etc/rcS.d/*ppp*
69 # install packages from network sources
70 killall apt-get || true
73 DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim bzrtools bzr-svn patchutils offlineimap wipe diffstat gtimelog jigdo-file libtool devhelp python-doc manpages-dev gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-ffmpeg weechat weechat-plugins weechat-scripts dpatch wdiff debian-goodies ccache subversion listadmin quilt python-dev cryptsetup mutt editmoin lintian python-gtk2-doc fakechroot ubuntu-dev-tools dput dchroot fakechroot imagemagick pngquant pdfjam easytag rsnapshot texlive-lang-german texlive-latex-extra python-coverage powertop sane-utils vim-scripts libtemplate-perl kvm bzr-buildpackage git-core greasemonkey build-essential fakeroot devscripts
74 apt-get -y build-dep postgresql-8.4 hal cups apport jockey calibre gvfs devicekit-disks devicekit-power
77 crontab -u martin - <<EOF
78 # m h dom mon dow command
79 05 * * * * \$HOME/bin/backup >/dev/null
82 if [ -x /usr/bin/gtimelog ]; then
83 patch /usr/bin/gtimelog ~martin/archiv/gtimelog.tuesday.patch