summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/0xffWireless.j2
blob: 4f282b8db9c547b0d004bc47ad27d99f20f6364b (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
31
32
#!/bin/sh

SHORT_NAME="0xffwireless"
DESC_NAME="Funkfeuer Freenet 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
    iw reg set AT
    iw dev $INTERFACE del
    iw phy phy0 interface add $INTERFACE type ibss
    ip link set up dev $INTERFACE
    iw --debug $INTERFACE ibss join http://graz.funkfeuer.at/v13 2472 CA:00:24:00:C0:13
    ip addr add dev $INTERFACE 10.12.233.11/16
    olsrd -f /etc/olsrd/olsrd.wireless.conf
    echo "search graz.funkfeuer.at" > /etc/resolv.conf
    echo "nameserver 10.12.0.10" >> /etc/resolv.conf
    ;;
  stop)
    echo "Disconnecting from $DESC_NAME"
    killall olsrd
    deactivate_interface $INTERFACE $MODULE_NAME
    ;;
  *)
    exit 1
    ;;
esac