summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/helsinkiWireless.j2
blob: b66c308b713d786b4b5235ed19192109b59b7934 (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
33
34
#!/bin/sh

SHORT_NAME="helsinkiwireless"
DESC_NAME="helsinki WIRELESS"
INTERFACE="{{ ws_minet_wireless_interface_name }}"
MODULE_NAME="{{ ws_minet_wireless_interface_module }}"
SSID="helsinki"

. /usr/local/lib/minet/minet_helpers.sh

case "$1" in
  start|"")
    echo "Connecting with $DESC_NAME"
    activate_interface $INTERFACE $MODULE_NAME
    echo 0 > /proc/sys/net/ipv6/conf/$INTERFACE/accept_ra
    wpa_supplicant -c/etc/wpa_supplicant.conf -i$INTERFACE -Dnl80211 -B
    wpa_select_ssid $INTERFACE "$SSID"
    ip link set up dev $INTERFACE
    ip addr add dev $INTERFACE 192.168.1.42/24
    ip route add default via 192.168.1.254
#    ip -6 addr add dev $INTERFACE 2a02:3e0:2003:1::42/64
#    ip -6 route add default via 2a02:3e0:2003:1::1
    echo "domain helsinki.at\nnameserver 192.168.1.254" | resolvconf -a $INTERFACE
    ;;
  stop)
    echo "Disconnecting from $DESC_NAME"
    killall wpa_supplicant
    deactivate_interface $INTERFACE $MODULE_NAME
    resolvconf -d $INTERFACE
    ;;
  *)
    exit 1
    ;;
esac