diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-16 04:15:05 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-16 04:25:42 +0200 |
commit | 0c52dfa8a26afef5cf53b2445ee89d4b98945f5e (patch) | |
tree | 78d8a2f94a3719087d447eed602519685c73bcdb /src/tools/wg-quick/linux.bash | |
parent | wg-quick: darwin: restore DNS on down (diff) | |
download | wireguard-monolithic-historical-0c52dfa8a26afef5cf53b2445ee89d4b98945f5e.tar.xz wireguard-monolithic-historical-0c52dfa8a26afef5cf53b2445ee89d4b98945f5e.zip |
wg-quick: darwin: use bash from environment and require bash 4+
For properly configured Homebrew installations /usr/local/bin should be
before /bin, so this should still work. This allows the script to be
used in more than one setting.
Diffstat (limited to '')
-rwxr-xr-x | src/tools/wg-quick/linux.bash | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash index cd66b4d..38ccad2 100755 --- a/src/tools/wg-quick/linux.bash +++ b/src/tools/wg-quick/linux.bash @@ -26,6 +26,16 @@ CONFIG_FILE="" PROGRAM="${0##*/}" ARGS=( "$@" ) +cmd() { + echo "[#] $*" >&2 + "$@" +} + +die() { + echo "$PROGRAM: $*" >&2 + exit 1 +} + parse_options() { local interface_section=0 line key value stripped CONFIG_FILE="$1" @@ -68,16 +78,6 @@ read_bool() { esac } -cmd() { - echo "[#] $*" >&2 - "$@" -} - -die() { - echo "$PROGRAM: $*" >&2 - exit 1 -} - auto_su() { [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " "$SELF" "${ARGS[@]}" } |