-config_tree_prefix="${HOME}/config/all_new_2018//"
-cp "${config_tree_prefix}"/user_scripts/start_plomlombot.sh /home/plom/
-chown plom:plom /home/plom/start_plomlombot.sh
-apt -y install screen python3-venv
+# Ensure we have a GPG target to encrypt to.
+if [ $# -lt 1 ]; then
+ echo "Need public key ID as argument."
+ false
+fi
+gpg_key="$1"
+
+config_tree_prefix="${HOME}/config/all_new_2018/"
+irclogs_dir=/var/www/html/irclogs
+irclogs_pw_dir=/var/www/irclogs_pw
+cp "${config_tree_prefix}"/user_scripts/plomlombot_daemon.sh /home/plom/
+chown plom:plom /home/plom/plomlombot_daemon.sh
+apt -y install screen python3-venv gpg dirmngr apache2-utils
+su plom -c "gpg --recv-key ${gpg_key}"
+# TODO: After this, we could in theory remove dirmngr if we only installed it just now.
+su plom -c "cd && git clone /var/public_repos/plomlombot-irc"