From 0eac4b2ad956b9615a2568e842c7057a23d4c0a1 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Mon, 7 Dec 2020 23:12:19 -0800 Subject: [PATCH] move destroy_tun_device into do_disconnect (called only here) Signed-off-by: Daniel Lenski --- vpnc-script | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/vpnc-script b/vpnc-script index 9722831..7befb97 100755 --- a/vpnc-script +++ b/vpnc-script @@ -244,17 +244,6 @@ do_ifconfig() { fi } -destroy_tun_device() { - case "$OS" in - NetBSD|OpenBSD) # and probably others... - ifconfig "$TUNDEV" destroy - ;; - FreeBSD|DragonFly) - ifconfig "$TUNDEV" destroy > /dev/null 2>&1 & - ;; - esac -} - # =========== route handling ==================================== if [ -n "$IPROUTE" ]; then @@ -1134,7 +1123,14 @@ do_disconnect() { ifconfig "$TUNDEV" down fi - destroy_tun_device + case "$OS" in + NetBSD|OpenBSD) # and probably others... + ifconfig "$TUNDEV" destroy + ;; + FreeBSD|DragonFly) + ifconfig "$TUNDEV" destroy > /dev/null 2>&1 & + ;; + esac } do_attempt_reconnect() { -- 2.49.0