wg-quick: use invoking shell in auto rooting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
6c407ae27b
commit
fe9bc71e40
|
@ -9,6 +9,7 @@ shopt -s extglob
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
SELF="${BASH_SOURCE[0]}"
|
SELF="${BASH_SOURCE[0]}"
|
||||||
|
[[ $SELF == */* ]] || SELF="./$SELF"
|
||||||
SELF="$(cd "${SELF%/*}" && pwd -P)/${SELF##*/}"
|
SELF="$(cd "${SELF%/*}" && pwd -P)/${SELF##*/}"
|
||||||
export PATH="${SELF%/*}:$PATH"
|
export PATH="${SELF%/*}:$PATH"
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ read_bool() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto_su() {
|
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() {
|
get_real_interface() {
|
||||||
|
|
|
@ -79,7 +79,7 @@ read_bool() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto_su() {
|
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[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_if() {
|
add_if() {
|
||||||
|
|
Reference in New Issue