--- /dev/null
+#!/bin/sh
+set -e
+
+if [ "$#" -ne 1 ]; then
+ echo 'Need old server IP.'
+ false
+fi
+old_server="$1"
+config_tree_prefix="${HOME}/config/buster"
+cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
+su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
+rm /home/plom/{prepare_to_meet_server,mirror_dir}.sh
su -lc "cd /var/repos && git clone --mirror ${old_server}:repos/website" plom
cp "${config_tree_prefix}/other_files/website_hook_post-receive" /var/repos/website.git/hooks/post-receive
su -lc 'cd /var/www && git clone /var/repos/website.git .' plom
+rm /home/plom/prepare_to_meet_server.sh
# Add encryption key.
keyservers='sks-keyservers.net/ keys.gnupg.net'
systemctl enable plomlombot.service
service plomlombot start
-# Migrate borg repo.
-cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
-su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
-
-# Clean up
-rm /home/plom/{prepare_to_meet_server,mirror_dir}.sh
-
# TODO:
# - commit git-daemon-export-ok directly into the public repos; rename
# /home/plom/public_repos to /home/plom/repos