mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 08:03:10 +02:00
not running the letsencrypt-auto script as root, but use su if sudo not found
This commit is contained in:
+5
-4
@@ -14,15 +14,16 @@ VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"}
|
|||||||
VENV_BIN=${VENV_PATH}/bin
|
VENV_BIN=${VENV_PATH}/bin
|
||||||
|
|
||||||
if test "`id -u`" -ne "0" ; then
|
if test "`id -u`" -ne "0" ; then
|
||||||
if type sudo &>/dev/null; then
|
if ! type sudo &>/dev/null; then
|
||||||
SUDO=sudo
|
function sudo (){
|
||||||
else
|
|
||||||
args=("$@")
|
args=("$@")
|
||||||
for i in "${!args[@]}"; do
|
for i in "${!args[@]}"; do
|
||||||
args[$i]="'$(printf "%s" "${args[$i]}" | sed -e "s/'/'\"'\"'/g")' "
|
args[$i]="'$(printf "%s" "${args[$i]}" | sed -e "s/'/'\"'\"'/g")' "
|
||||||
done
|
done
|
||||||
exec su root -c "$0 ${args[*]}"
|
su root -c "${args[*]}"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
SUDO=sudo
|
||||||
else
|
else
|
||||||
SUDO=
|
SUDO=
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user