]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
handle creating/destroying the tun device on OpenBSD
authorStuart Henderson <sthen@openbsd.org>
Thu, 8 Nov 2012 19:37:59 +0000 (19:37 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 8 Nov 2012 20:59:04 +0000 (20:59 +0000)
Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
vpnc-script

index 9737995584a9ffa2e7f05caedb303027ce57d0d8..934e044af1538d142e3ba0f937a31fc886439fc5 100755 (executable)
@@ -198,7 +198,7 @@ do_ifconfig() {
 
 destroy_tun_device() {
        case "$OS" in
-       NetBSD|FreeBSD) # and probably others...
+       NetBSD|FreeBSD|OpenBSD) # and probably others...
                ifconfig "$TUNDEV" destroy
                ;;
        esac
@@ -317,7 +317,7 @@ else # use route command
 
        del_network_route() {
                case "$OS" in
-               Linux|NetBSD|Darwin|SunOS) # and probably others...
+               Linux|NetBSD|OpenBSD|Darwin|SunOS) # and probably others...
                        # routes are deleted automatically on device shutdown
                        return
                        ;;
@@ -603,6 +603,9 @@ do_pre_init() {
        elif [ "$OS" = "NetBSD" ]; then
                :
        elif [ "$OS" = "OpenBSD" ]; then
+               if ! ifconfig $TUNDEV > /dev/null; then
+                       ifconfig $TUNDEV create
+               fi
                :
        elif [ "$OS" = "SunOS" ]; then
                :