From: Daniel Lenski Date: Tue, 8 Dec 2020 07:12:19 +0000 (-0800) Subject: move destroy_tun_device into do_disconnect (called only here) X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0eac4b2ad956b9615a2568e842c7057a23d4c0a1;p=users%2Fdwmw2%2Fvpnc-scripts.git move destroy_tun_device into do_disconnect (called only here) Signed-off-by: Daniel Lenski --- 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() {