#!/bin/sh IFACE="wlan0" WIFIDEV="ath0" CLONEOPTS="" REGDOMAIN="" COUNTRY="" DEFTXKEY="1" KEY_1="public_key" KEY_2="" KEY_3="" KEY_4="" SSID="wep-ap" CHAN="36:a" BINT="100" WIFIOPTS="-bgscan authmode shared" OPTS="" IP="172.31.1.1/30" IP6="" [ -r /etc/rc.wifi ] && . /etc/rc.wifi [ -z "$IFACE" -o -z "$WIFIDEV" ] && exit echo "Config wireless AP (WEP) interface $IFACE ..." ifconfig $IFACE create wlandev $WIFIDEV $CLONEOPTS wlanmode hostap || exit if [ -n "$REGDOMAIN" ]; then ifconfig $IFACE regdomain $REGDOMAIN fi if [ -n "$COUNTRY" ]; then ifconfig $IFACE country $COUNTRY fi if [ -n "$WIFIOPTS" ]; then ifconfig $IFACE $WIFIOPTS fi if [ -n "$BINT" ]; then ifconfig $IFACE bintval $BINT fi if [ -n "$CHAN" ]; then ifconfig $IFACE channel $CHAN fi if [ -n "$SSID" ]; then ifconfig $IFACE ssid $SSID fi setWEP $IFACE $DEFTXKEY "$KEY_1" "$KEY_2" "$KEY_3" "$KEY_4" if [ -n "$IP" ]; then ifconfig $IFACE inet $IP fi if [ -n "$IP6" ]; then ifconfig $IFACE inet6 $IP6 fi ifconfig $IFACE $OPTS up [ -x /etc/sysctl.$IFACE ] && /etc/sysctl.$IFACE [ -x /etc/wifi_up.sh ] && /etc/wifi_up.sh $IFACE >/dev/null 2>&1 & #wlandebug -i $IFACE state+scan+assoc+crypto+11n