diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-01 21:42:32 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-02 02:45:53 +0200 |
commit | 41d1c6953bf6a80473155e13899d5205ffdc625e (patch) | |
tree | 31a222e599ddf6b06b52bf92f733f7d3b410b8b9 | |
parent | wg-quick: anchor sysctl regex to start and end (diff) | |
download | wireguard-monolithic-historical-41d1c6953bf6a80473155e13899d5205ffdc625e.tar.xz wireguard-monolithic-historical-41d1c6953bf6a80473155e13899d5205ffdc625e.zip |
wg-quick: verify wireguard interface in more clever way
This helps with old Debian which has ancient iproute2, as well as paving
the path toward this script supporting userspace implementations.
-rwxr-xr-x | src/tools/wg-quick.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index c70c078..5295c8b 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -249,7 +249,7 @@ cmd_up() { } cmd_down() { - [[ -n $(ip link show dev "$INTERFACE" type wireguard 2>/dev/null) ]] || die "\`$INTERFACE' is not a WireGuard interface" + [[ " $(wg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface" execute_hook "$PRE_DOWN" [[ $SAVE_CONFIG -eq 0 ]] || save_config unset_dns |