]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
move destroy_tun_device into do_disconnect (called only here)
authorDaniel Lenski <dlenski@gmail.com>
Tue, 8 Dec 2020 07:12:19 +0000 (23:12 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 25 Jan 2021 05:48:40 +0000 (21:48 -0800)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
vpnc-script

index 97228319241d55c14711acf9281d0d5a7d472d94..7befb975d19d57f6f0d07b7a3fafa1a005722e31 100755 (executable)
@@ -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() {