summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selfpublish.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/selfpublish.sh b/selfpublish.sh
index 6ab7374..072ee6e 100644
--- a/selfpublish.sh
+++ b/selfpublish.sh
@@ -83,10 +83,12 @@ dpkg_install()
83 apt-cache policy | grep -q 'http://httpredir.debian.org/debian buster-backports/main' || 83 apt-cache policy | grep -q 'http://httpredir.debian.org/debian buster-backports/main' ||
84 write_line_once /etc/apt/sources.list.d/buster-backports.list \ 84 write_line_once /etc/apt/sources.list.d/buster-backports.list \
85 'deb http://httpredir.debian.org/debian buster-backports main' 85 'deb http://httpredir.debian.org/debian buster-backports main'
86 as_root $SHELL -c "set -$- +e; dpkg -i $*; apt-get -t buster-backports -f install"
87 ;;
88 *)
89 as_root $SHELL -c "set -$- +e; dpkg -i $*; apt-get -f install"
86 ;; 90 ;;
87 esac 91 esac
88
89 as_root $SHELL -c "set -$- +e; dpkg -i $*; apt-get -t buster-backports -f install"
90} 92}
91 93
92fmt_dependencies() 94fmt_dependencies()
@@ -149,7 +151,7 @@ control_file_file_check()
149 if ! diff -q "$2" "$tempout" 151 if ! diff -q "$2" "$tempout"
150 then 152 then
151 RESULT=1 153 RESULT=1
152 install -v -m "$3" "$tempout" -T "$2" 154 as_root install -v -m "$3" "$tempout" -T "$2"
153 fi 155 fi
154 header=$data 156 header=$data
155 continue 2 157 continue 2
@@ -539,13 +541,13 @@ equivocate()
539 cd "$destdir" 541 cd "$destdir"
540 control_file > ./control 542 control_file > ./control
541 equivs-build ./control >&2 543 equivs-build ./control >&2
542 DEB=${SELF_PACKAGE}_${SELF_VERSION}_all.deb 544 DEB=../${SELF_PACKAGE}_${SELF_VERSION}_all.deb
543 545
544 if ! [ "$NO_APT" ] 546 if ! [ "$NO_APT" ]
545 then 547 then
546 as_root dpkg -r "${SELF_PACKAGE}" 548 as_root dpkg -r "${SELF_PACKAGE}"
547 dpkg_install "$DEB" 549 dpkg_install "$DEB"
548 install -m0644 "$DEB" "$DEBDEST" 550 as_root install -m0644 "$DEB" "$DEBDEST"
549 fi 551 fi
550 ) || exit 552 ) || exit
551} 553}
@@ -613,7 +615,7 @@ enable_apache_modules()
613 done 615 done
614 if [ "$restart" ] 616 if [ "$restart" ]
615 then 617 then
616 systemctl restart apache2 618 as_root systemctl restart apache2
617 fi 619 fi
618} 620}
619 621
@@ -740,7 +742,7 @@ install_self_to_site()
740 cp -Tuv "$src" "$dst" >&2 742 cp -Tuv "$src" "$dst" >&2
741 cp -Tuv "$src" "$dst".txt >&2 743 cp -Tuv "$src" "$dst".txt >&2
742 fi 744 fi
743 DEB="${SELF_PACKAGE}_${SELF_VERSION}_all.deb" 745 DEB=${SELF_PACKAGE}_${SELF_VERSION}_all.deb
744 if [ -e "$DEB" ] 746 if [ -e "$DEB" ]
745 then 747 then
746 cp -Tuv "$DEB" "$SITE_DIR/public_html/$DEB" 748 cp -Tuv "$DEB" "$SITE_DIR/public_html/$DEB"
@@ -968,11 +970,11 @@ configure_apache_vhost
968 970
969if [ $tls_result != 0 ] || force 971if [ $tls_result != 0 ] || force
970then 972then
971 systemctl restart apache2 973 as_root systemctl restart apache2
972 wait_for_certificate_issuance "$DOMAIN" 974 wait_for_certificate_issuance "$DOMAIN"
973 systemctl reload apache2 || systemctl restart apache2 975 as_root systemctl reload apache2 || as_root systemctl restart apache2
974else 976else
975 systemctl reload apache2 || systemctl restart apache2 977 as_root systemctl reload apache2 || as_root systemctl restart apache2
976fi 978fi
977 979
978check_tls "$DOMAIN" 980check_tls "$DOMAIN"