| #!/bin/sh |
| . /etc/utils.sh |
| |
| case "$1" in |
| start) |
| if runnable wl && has_wifi; then |
| wifi="eth2" |
| wifisys=/sys/class/net/$wifi/address |
| wifimac=$(cat $wifisys) |
| wl ap 1 |
| wl radio off |
| wl bssid "$wifimac" |
| fi |
| # Qualcomm Atheros WLAN. |
| # TODO(apenwarr): don't hardcode this, let catawampus do it eventually. |
| if runnable iwconfig; then |
| serial=$(serial) |
| [ -z "$serial" ] && serial=unknown |
| # TODO(apenwarr): WPA2 doesn't work reliably in current driver version. |
| # So for now we'll test with no encryption. |
| export WIFI_PSK=gfdogfood |
| wifi set -b 2.4 -s GFRG_${serial}_11n -e NONE |
| wifi set -b 5 -s GFRG_${serial}_11ac -e NONE |
| fi |
| ;; |
| stop) |
| ;; |
| restart) |
| $0 stop; $0 start |
| ;; |
| *) |
| echo "Usage: $0 {start|stop|restart}" |
| exit 1 |
| esac |