echo 'Need domain name and mail and key ID and init state and possibly old server IP as argument.'
false
fi
-if [ ! "$4" = "copy" ] && [ ! "$4" = "new" ] && [ ! "$4" = "upgrade" ]; then
- echo "Need init state to be either 'copy' or 'new' or 'upgrade'"
+if [ ! "$4" = "copy" ] && [ ! "$4" = "new" ]; then
+ echo "Need init state to be either 'copy' or 'new'."
false
fi
if [ ! "$4" = "new" ] && [ "$#" -ne 5 ]; then
init_state="$4"
old_server="$5"
-# NOTE: init_state=upgrade is for migration from older stretch server setup
-
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/bullseye"
./install_for_target.sh web website
rm -rf /var/www
mkdir /var/www
chown plom:plom /var/www
-if [ "${init_state}" = "upgrade" ]; then
- # This assumes the old core.plomlompom.com filesystem hierarchy.
- su -lc "cd /var/repos && git clone --mirror plom@core.plomlompom.com:repos/website" plom
-elif [ "${init_state}" = "new" ]; then
+if [ "${init_state}" = "new" ]; then
su -lc "cd /var/repos && git init --bare website.git" plom
fi
cp "${config_tree_prefix}/other_files/website_hook_post-receive" /var/repos/website.git/hooks/post-receive
mkdir -p "${irclogs_pw_dir}"
chown -R plom:plom "${irclogs_pw_dir}"
if [ "${init_state}" = "new" ]; then
- # Handle the case that the repo is in the old pre-buster server setup –
- # even then, the URL should be the same.
+ # TODO investigate whether we can get rid of anything here
+ # Handle the case that the repo is in the old pre-buster server setup –
+ # even then, the URL should be the same.
su -lc "cd /var/repos && git clone --mirror https://plomlompom.com/repos/clone/plomlombot-irc" plom
su -lc "touch /var/repos/plomlombot-irc.git/git-daemon-export-ok" plom
cp "${config_tree_prefix}/other_files/plomlombot_hook_post-receive" /var/repos/plomlombot-irc.git/hooks/post-receive
su -lc "./mirror_dir.sh ${old_server} /home/plom/plomlombot_db" plom
rm /home/plom/mirror_dir.sh
su -lc "scp plom@${old_server}:.plomlombot ~" plom
- su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
+ # TODO su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
fi
-systemctl enable plomlombot.service
-service plomlombot start
+# TODO systemctl enable plomlombot.service
+# TODO service plomlombot start
# In the above step, we might have created a root-owned /var/www/html –
# fix this here.