home · contact · privacy
Fix web server migration script bugs.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 14 Dec 2018 23:53:10 +0000 (00:53 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 14 Dec 2018 23:53:10 +0000 (00:53 +0100)
all_new_2018/mirror_dir.sh
all_new_2018/setup_plomlombot.sh
all_new_2018/setup_web.sh

index 688b2b810cb0c3dbf9dfb2f12966fd991bb22c44..cb943c9c9bb8e8014eca81b6c2b2e03ffe961913 100755 (executable)
@@ -13,7 +13,7 @@ eval `ssh-agent`
 ssh-add
 cd
 ssh plom@"${server}" "cd \"${dir}\" && tar cf ${path_package} ."
-scp plom@"${server}":"${path_package}" .
+scp plom@"${server}":"${path_package}" "${path_package}"
 mkdir -p "${dir}"
 cd "${dir}"
 tar xf "${path_package}"
index 1de8ae2d7d7d13f70593f3df3eea77afef20c2d9..135bbd2ad77eea2f654b592f910c3e5dd63a943b 100755 (executable)
@@ -13,23 +13,25 @@ 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 gnupg
+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
+    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
index e81b1053f816c0184f5f4def2afaefcaff071138..661aa7416a0f1011a204fd7f20800faa7004c367 100755 (executable)
@@ -4,10 +4,10 @@ set -e
 ./hardlink_etc.sh web
 sed -i "s/REPLACE_fqdn_ECALPER/$(hostname -f)/g" /etc/nginx/nginx.conf
 sed -i "s/REPLACE_fqdn_ECALPER/$(hostname -f)/g" /etc/gitweb.conf
-apt -y -o Dpkg::Options::=--force-confold install nginx gitweb fcgiwrap
 cd /var/
 rm -rf www
 git clone plom@core.plomlompom.com:repos/website www
+apt -y -o Dpkg::Options::=--force-confold install nginx gitweb fcgiwrap
 mkdir /var/public_repos
 chown plom:plom /var/public_repos
 iptables-restore /etc/iptables/rules.v4