From dde1fd94cfcac8cba4cd5d85a6b8006fdededf60 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 7 Oct 2021 21:02:16 -0400 Subject: fix failures to sudo when run as non-root user --- selfpublish.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/selfpublish.sh b/selfpublish.sh index 6ab7374..1d97356 100644 --- a/selfpublish.sh +++ b/selfpublish.sh @@ -149,7 +149,7 @@ control_file_file_check() if ! diff -q "$2" "$tempout" then RESULT=1 - install -v -m "$3" "$tempout" -T "$2" + as_root install -v -m "$3" "$tempout" -T "$2" fi header=$data continue 2 @@ -545,7 +545,7 @@ equivocate() then as_root dpkg -r "${SELF_PACKAGE}" dpkg_install "$DEB" - install -m0644 "$DEB" "$DEBDEST" + as_root install -m0644 "$DEB" "$DEBDEST" fi ) || exit } @@ -613,7 +613,7 @@ enable_apache_modules() done if [ "$restart" ] then - systemctl restart apache2 + as_root systemctl restart apache2 fi } @@ -968,11 +968,11 @@ configure_apache_vhost if [ $tls_result != 0 ] || force then - systemctl restart apache2 + as_root systemctl restart apache2 wait_for_certificate_issuance "$DOMAIN" - systemctl reload apache2 || systemctl restart apache2 + as_root systemctl reload apache2 || as_root systemctl restart apache2 else - systemctl reload apache2 || systemctl restart apache2 + as_root systemctl reload apache2 || as_root systemctl restart apache2 fi check_tls "$DOMAIN" -- cgit v1.2.3