blob: eccb9a43b0efb085bef653919a2b4d496a3f4c4b (
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
|
#!/bin/sh
SHORT_NAME="westbuswireless"
DESC_NAME="westbus 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
ESSID=`iw $INTERFACE scan | grep "SSID:" | grep "WESTlan" | head -1 | sed 's/^.*SSID: //'`
iw dev $INTERFACE connect "$ESSID"
dhclient $INTERFACE -v -pf /var/run/dhclient.$SHORT_NAME.pid
;;
stop)
echo "Disconnecting from $DESC_NAME"
deactivate_interface $INTERFACE $MODULE_NAME
dhclient -x -pf /var/run/dhclient.$SHORT_NAME.pid
;;
*)
exit 1
;;
esac
|