#!/bin/sh SHORT_NAME="tugwireless" DESC_NAME="tug WIRELESS" INTERFACE="{{ ws_minet_wireless_interface_name }}" MODULE_NAME="{{ ws_minet_wireless_interface_module }}" . /usr/local/lib/minet/minet_helpers.sh case "$1" in start|"") echo "Connecting with $DESC_NAME" activate_interface $INTERFACE $MODULE_NAME iwconfig $INTERFACE essid "tug" mode Managed 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 /var/run/dhclient.$SHORT_NAME.pid deactivate_interface $INTERFACE $MODULE_NAME ;; *) exit 1 ;; esac