From 08a7568f43f4f04962264e5bc3875f9971064fda Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 15 Dec 2018 19:19:48 +0100 Subject: [PATCH] Refactor scripts that add encryption keys. --- all_new_2018/setup_scripts/setup_play.sh | 1 + .../setup_scripts/setup_plomlombot.sh | 22 +++---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/all_new_2018/setup_scripts/setup_play.sh b/all_new_2018/setup_scripts/setup_play.sh index 020c13d..2d9849d 100755 --- a/all_new_2018/setup_scripts/setup_play.sh +++ b/all_new_2018/setup_scripts/setup_play.sh @@ -12,6 +12,7 @@ config_tree_prefix="${HOME}/config/all_new_2018" setup_scripts_dir="${config_tree_prefix}/setup_scripts" cd "${setup_scripts_dir}" +./add_encryption_key.sh "${gpg_key}" config_tree_prefix="${HOME}/config/all_new_2018/" ./hardlink_etc.sh play apt -y install weechat screen vim diff --git a/all_new_2018/setup_scripts/setup_plomlombot.sh b/all_new_2018/setup_scripts/setup_plomlombot.sh index 5a45b6f..de22ef3 100755 --- a/all_new_2018/setup_scripts/setup_plomlombot.sh +++ b/all_new_2018/setup_scripts/setup_plomlombot.sh @@ -11,27 +11,11 @@ gpg_key="$1" config_tree_prefix="${HOME}/config/all_new_2018" irclogs_dir=/var/www/html/irclogs irclogs_pw_dir=/var/www/irclogs_pw + +./add_encryption_key.sh "${gpg_key}" +apt -y install screen python3-venv cp "${config_tree_prefix}"/user_files/plomlombot_daemon.sh /home/plom/ chown plom:plom /home/plom/plomlombot_daemon.sh -apt -y install screen python3-venv gnupg dirmngr -keyservers='sks-keyservers.net/ keys.gnupg.net' -set +e -while true; do - do_break=0 - for keyserver in $(echo "${keyservers}"); do - su plom -c "gpg --no-tty --keyserver $keyserver --recv-key ${gpg_key}" - if [ $? -eq "0" ]; then - do_break=1 - break - fi - echo "Attempt with keyserver ${keyserver} unsuccessful, trying other." - done - if [ "${do_break}" -eq "1" ]; then - break - fi -done -set -e -# TODO: We may remove dirmngr here if only this script installed it. su plom -c "cd && git clone /var/public_repos/plomlombot-irc" systemctl enable /etc/systemd/system/plomlombot.service service plomlombot start -- 2.30.2