--- /dev/null
+#!/bin/sh
+blog_dir=~/blog
+export GIT_DIR=$(pwd)
+export GIT_WORK_TREE="$blog_dir"
+git checkout -f
+cd "$GIT_WORK_TREE"
+redo
+git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata captchas/linkable/*
+count=$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l)
+if [ "$count" != 0 ]; then
+ git add metadata/*.automatic_metadata
+fi
+status=$(git status -s)
+n_updates=$(printf "$status" | grep -vE '^\?\?' | wc -l)
+if [ "$n_updates" -gt 0 ]; then
+ git commit -a -m 'Update metadata'
+fi
echo "foo:{PLAIN}${password_geheim}" > /var/www-dump/password_geheim
echo "geheim password is: ${password_geheim}"
-# Set up zettel and redo.
+# Set up redo.
wget http://news.dieweltistgarnichtso.net/bin/archives/redo-sh.tar.gz
tar -moxzf redo-sh.tar.gz -C /usr/local
+
+# Set up connection to old dump server.
cp "${config_tree_prefix}/setup_scripts/prepare_to_meet_server.sh" /home/plom/
chown plom:plom /home/plom/prepare_to_meet_server.sh
su -lc "./prepare_to_meet_server.sh ${old_server}" plom
-su -lc "cd /var/repos && git clone --mirror ${old_server}:zettel.git" plom
+read -p'Hit Enter when you are done.' ignore
+rm /home/plom/prepare_to_meet_server.sh
+
+# Set up zettel.
+su -lc "git clone --mirror ${old_server}:zettel.git" plom
cp "${config_tree_prefix}/other_files/zettel_hook_post-receive" /home/plom/zettel.git/hooks/
-su -lc "git clone ~/zettel.git" plom
+su -lc "git clone ~/zettel.git && cd zettel && redo" plom
su -lc "ln -s /home/plom/zettel /var/www-dump/zettel" plom
-rm /home/plom/prepare_to_meet_server.sh
+
+# Set up redo blog.
+su -lc "git clone --mirror ${old_server}:blog.git" plom
+cp "${config_tree_prefix}/other_files/blog_hook_post-receive" /home/plom/blog.git/hooks/
+su -lc "git clone ~/blog.git" plom
+# FIXME: we should not depend on a GitHub repo
+su -lc "git clone https://github.com/plomlompom/redo-blog.git" plom
+su -lc "cd redo-blog && ./add_dir.sh ~/blog" plom
+su -lc "cd blog && redo" plom
+su -lc "ln -s /home/plom/blog/public /var/www-dump/blog" plom
# Prepare NGINX.
sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx