diff --git a/letsencrypt-auto b/letsencrypt-auto index 514f03f46..cfc830c9f 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -15,12 +15,13 @@ VENV_BIN=${VENV_PATH}/bin if test "`id -u`" -ne "0" ; then if ! type sudo &>/dev/null; then - function sudo (){ - args=("$@") - for i in "${!args[@]}"; do - args[$i]="'$(printf "%s" "${args[$i]}" | sed -e "s/'/'\"'\"'/g")' " + sudo() { + args="" + while [ $# -ne 0 ]; do + args="$args'$(printf "%s" "$1" | sed -e "s/'/'\"'\"'/g")' " + shift done - su root -c "${args[*]}" + su root -c "$args" } fi SUDO=sudo