aboutsummaryrefslogtreecommitdiff
path: root/files/openvpn/destroy_openvpn_interface
diff options
context:
space:
mode:
Diffstat (limited to 'files/openvpn/destroy_openvpn_interface')
-rwxr-xr-xfiles/openvpn/destroy_openvpn_interface9
1 files changed, 9 insertions, 0 deletions
diff --git a/files/openvpn/destroy_openvpn_interface b/files/openvpn/destroy_openvpn_interface
new file mode 100755
index 0000000..aa89ed4
--- /dev/null
+++ b/files/openvpn/destroy_openvpn_interface
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+DEV="$1"
+SUBNET="$2"
+
+route del -net "$SUBNET".0 netmask 255.255.255.0 gw "$SUBNET".2
+ifconfig "$DEV" down
+openvpn --rmtun --dev "$DEV"
+