diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-16 19:19:48 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-16 19:19:48 +0200 |
commit | f6135f6e4925ae6bfdef38a1226e91187c7bc6d1 (patch) | |
tree | a16a474a8add12e13a6afb26a3451eed086e861e /src/tools/wg-quick/darwin.bash | |
parent | wg-quick: add intentionally undocumented userspace implementation knob (diff) | |
download | wireguard-monolithic-historical-f6135f6e4925ae6bfdef38a1226e91187c7bc6d1.tar.xz wireguard-monolithic-historical-f6135f6e4925ae6bfdef38a1226e91187c7bc6d1.zip |
wg-quick: use invoking shell in auto rooting
Diffstat (limited to 'src/tools/wg-quick/darwin.bash')
-rwxr-xr-x | src/tools/wg-quick/darwin.bash | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/wg-quick/darwin.bash b/src/tools/wg-quick/darwin.bash index 0eef3d9..581954c 100755 --- a/src/tools/wg-quick/darwin.bash +++ b/src/tools/wg-quick/darwin.bash @@ -9,6 +9,7 @@ shopt -s extglob export LC_ALL=C SELF="${BASH_SOURCE[0]}" +[[ $SELF == */* ]] || SELF="./$SELF" SELF="$(cd "${SELF%/*}" && pwd -P)/${SELF##*/}" export PATH="${SELF%/*}:$PATH" @@ -82,7 +83,7 @@ read_bool() { } auto_su() { - [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " "$SELF" "${ARGS[@]}" + [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " -- "$BASH" -- "$SELF" "${ARGS[@]}" } get_real_interface() { |