rm -rf /home/martin/backup
fi
-# install already shipped debs
-[ -e /mirror ] || ln -s /home/ubuntu-mirror /mirror
-mount -o loop /home/martin/download/ubuntu/hardy-alternate-amd64.iso /cdrom
-apt-cdrom -m add
-DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential fakeroot devscripts postfix openssh-server bzr
+# need bzr and postfix for the setup below
+DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko
# root's ssh stuff
-if [ ! -d /root/ssh ]; then
+if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
- cp /home/martin/.ssh/id_dsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /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
cd /etc
if [ ! -d /etc/.bzr ]; then
for i in passwd group shadow fstab; do
- cp $i $i.originst
+ [ -e $i.originst ] || cp $i $i.originst
done
- bzr get bzr+ssh://martin@piware.de/home/martin/backup/desktop-etc /desktop-etc
- cp -av /desktop-etc/* /etc/
- cp -av /desktop-etc/.bzr/ /etc/
- rm -rf /desktop-etc
+ [ -e /backup-etc ] || bzr get 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
-fi
-
-# only restore dchroot part into fstab
-grep -A 200 "^# dchroots" fstab >> fstab.originst
-mv fstab.originst fstab
-
-# only restore the human users from passwd/group
-for i in passwd group; do
- perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst
- mv $i.originst $i
-done
+ chmod 640 /etc/shadow
+ chown root:shadow /etc/shadow
+ chmod 700 /etc/ssl/private
+ chmod 640 /etc/ssl/private/ssl-cert-*
+ chown root:ssl-cert /etc/ssl/private/ssl-cert*
+
+ # only restore dchroot part into fstab
+ grep -A 200 "^#.*chroot" fstab >> fstab.originst || true
+ mv fstab.originst fstab
+
+ # only restore the human users from passwd/group
+ for i in passwd group; do
+ perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst
+ mv $i.originst $i
+ done
-# only restore some passwords from shadow
-egrep 'martin|netti|joe' shadow >> shadow.originst
-mv shadow.originst shadow
+ # only restore some passwords from shadow
+ egrep 'martin|netti|joe' shadow >> shadow.originst
+ mv shadow.originst shadow
+ chown root:shadow shadow
+ chmod 640 shadow
+fi
# update postfix for new configuration
newaliases
/etc/init.d/postfix restart
-# copy apt cache
-if [ -d /home/aptcache ]; then
- find /home/aptcache/ -name "*.deb" -exec cp '{}' /var/cache/apt/archives/ \;
- rm -rf /home/aptcache
-fi
-
# other setup
-dpkg -i /home/martin/download/libdvdcss2_*deb || true
+dpkg -i /home/martin/download/libdvdcss2_*amd64.deb || true
locale-gen ru_RU ru_RU.UTF-8
-# cronjob goo
-killall apt-get || true
-
# remove packages that we do not need
-apt-get purge -y --auto-remove hplip brltty bluez-cups gnome-accessibility-themes gnome-mag gnome-orca onboard tomboy ttf-arabeyes ttf-arphic-uming ttf-baekmuk ttf-gentium ttf-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-mgopen ttf-thai-tlwg
-
-rm /etc/rcS.d/*pcmcia* /etc/rcS.d/*ppp*
+killall apt-get || true # cronjob goo
+apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpijs printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird || true
-# cronjob goo
-killall apt-get || true
+#rm -f /etc/rcS.d/*pcmcia* /etc/rcS.d/*ppp*
# install packages from network sources
-apt-get update -o Acquire::Http::No-Cache=true
-
-DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes vim bzrtools bzr-svn python-paramiko patchutils offlineimap wipe gnome-gpg diffstat dchroot gtimelog rsnapshot 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 dhcp3-server grep-dctrl ccache subversion listadmin quilt apache2 python-dev cryptsetup mutt editmoin lintian ia32-libs easytag latex-beamer python-gtk2-doc fakechroot
-apt-get -y build-dep postgresql-8.3 gnome-volume-manager hal cupsys apport jockey
+killall apt-get || true
+apt-get update
-umount /cdrom
+DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog libtool devhelp python-doc manpages-dev gstreamer0.10-fluendo-mp3 gstreamer0.10-ffmpeg weechat weechat-plugins weechat-scripts dpatch wdiff ccache listadmin quilt cryptsetup mutt editmoin lintian fakechroot ubuntu-dev-tools dput dchroot easytag rsnapshot texlive-lang-german texlive-latex-extra powertop qemu-kvm bzr-buildpackage git-core build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet germinate debootstrap wmctrl mumble qemu-kvm libnotify-bin pbuilder svn-buildpackage
-# other setup
-ln -s /mirror /var/www/mirror
-ifdown eth1
-ifup eth1
-/etc/init.d/dhcp3-server restart
-patch /usr/bin/gtimelog ~martin/archiv/gtimelog.wednesday.patch
+apt-get -y --no-install-recommends build-dep postgresql-9.1 cups apport calibre gvfs udisks upower gnome-disk-utility udev python-gobject
# crontabs
crontab -u martin - <<EOF
# m h dom mon dow command
05 * * * * \$HOME/bin/backup >/dev/null
EOF
+
+#if [ -x /usr/bin/gtimelog ]; then
+# patch --no-backup-if-mismatch /usr/share/pyshared/gtimelog/main.py ~martin/archiv/gtimelog.tuesday.patch
+#fi