summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/ccc2011Wireless.j2
blob: c0c1e8a244ef03ff69ead9eb4e05b6ebfd3e9dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

SHORT_NAME="ccc2011wireless"
DESC_NAME="CCCamp 2011 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 "ccc-2011" mode Managed
    sleep 2
    echo 0 > /proc/sys/net/ipv6/conf/$INTERFACE/autoconf
    echo 0 > /proc/sys/net/ipv6/conf/$INTERFACE/accept_ra
    iwconfig $INTERFACE channel 44
    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