summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/tugWireVpnc.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ws/minet/templates/connections/tugWireVpnc.j2')
-rwxr-xr-xroles/ws/minet/templates/connections/tugWireVpnc.j228
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/ws/minet/templates/connections/tugWireVpnc.j2 b/roles/ws/minet/templates/connections/tugWireVpnc.j2
new file mode 100755
index 00000000..1e261313
--- /dev/null
+++ b/roles/ws/minet/templates/connections/tugWireVpnc.j2
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+SHORT_NAME="tugwirevpnc"
+DESC_NAME="tug WIRE (vpnc)"
+INTERFACE="{{ ws_minet_wired_interface_name }}"
+MODULE_NAME="{{ ws_minet_wired_interface_module }}"
+
+. /usr/local/lib/minet/minet_helpers.sh
+
+case "$1" in
+ start|"")
+ echo "Connecting with $DESC_NAME"
+ activate_interface $INTERFACE $MODULE_NAME
+ dhclient $INTERFACE -v -pf /var/run/dhclient.$SHORT_NAME.pid
+ vpnc --natt-mode none --pid-file /var/run/vpnc.$SHORT_NAME.pid /etc/vpnc/tug.conf
+ ;;
+ stop)
+ echo "Disconnecting from $DESC_NAME"
+ kill `cat /var/run/vpnc.$SHORT_NAME.pid`
+ rm -f /var/run/vpnc.$SHORT_NAME.pid
+ kill `cat /var/run/dhclient.$SHORT_NAME.pid`
+ rm -f /var/run/dhclient.$SHORT_NAME.pid
+ deactivate_interface $INTERFACE $MODULE_NAME
+ ;;
+ *)
+ exit 1
+ ;;
+esac