diff options
Diffstat (limited to 'roles/ws/minet/templates/connections/dhcpWire.j2')
-rwxr-xr-x | roles/ws/minet/templates/connections/dhcpWire.j2 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/ws/minet/templates/connections/dhcpWire.j2 b/roles/ws/minet/templates/connections/dhcpWire.j2 new file mode 100755 index 00000000..3acee9a7 --- /dev/null +++ b/roles/ws/minet/templates/connections/dhcpWire.j2 @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Author: Christian Pointner <equinox@chaos-at-home.org> +# + +SHORT_NAME="dhcpwire" +DESC_NAME="anywhere(dhcp) WIRE" +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 + ;; + stop) + echo "Disconnecting from $DESC_NAME" + kill `cat /var/run/dhclient.$SHORT_NAME.pid` + rm /var/run/dhclient.$SHORT_NAME.pid + deactivate_interface $INTERFACE $MODULE_NAME + ;; + *) + exit 1 + ;; +esac |