--- elwix/config/etc/default/rc.d/011.ap_multi.stop 2014/09/15 19:06:45 1.3 +++ elwix/config/etc/default/rc.d/011.ap_multi.stop 2015/03/05 22:31:59 1.3.2.1 @@ -2,6 +2,7 @@ IFACE="wlan1" WIFIDEV="ath0" +CLONEOPTS="" REGDOMAIN="" COUNTRY="" @@ -12,20 +13,36 @@ BINT="100" WIFIOPTS="-bgscan" #WIFIOPTS="-bgscan -ampdutx -amsdu" -OPT="" +OPTS="" IP="172.31.2.1/30" +[ -z "$IFACE" -o -z "$WIFIDEV" ] && exit + echo "Config wireless AP interface $IFACE ..." -ifconfig $IFACE create wlandev $WIFIDEV wlanmode hostap -#ifconfig $IFACE regdomain $REGDOMAIN -#ifconfig $IFACE country $COUNTRY -ifconfig $IFACE $WIFIOPTS -ifconfig $IFACE bintval $BINT -ifconfig $IFACE channel $CHAN - -ifconfig $IFACE ssid $SSID -ifconfig $IFACE inet ${IP} ${OPT} up +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 +if [ -n "$IP" ]; then + ifconfig $IFACE inet $IP +fi +ifconfig $IFACE $OPTS up [ -x /etc/sysctl.$IFACE ] && /etc/sysctl.$IFACE