--- elwix/config/etc/default/rc.d/011.sta.stop 2011/11/02 09:51:32 1.2 +++ elwix/config/etc/default/rc.d/011.sta.stop 2015/03/05 23:02:12 1.2.18.2 @@ -2,6 +2,7 @@ IFACE="wlan0" WIFIDEV="ath0" +CLONEOPTS="" REGDOMAIN="" COUNTRY="" @@ -10,19 +11,50 @@ SSID="ap" BINT="100" WIFIOPTS="" -OPT="" +OPTS="" +#IP="auto" IP="172.31.1.2/30" +#IP6="auto" +IP6="" +[ -z "$IFACE" -o -z "$WIFIDEV" ] && exit + echo "Config wireless Station interface $IFACE ..." -ifconfig $IFACE create wlandev $WIFIDEV wlanmode sta -#ifconfig $IFACE regdomain $REGDOMAIN -#ifconfig $IFACE country $COUNTRY -ifconfig $IFACE $WIFIOPTS -ifconfig $IFACE bintval $BINT - -ifconfig $IFACE ssid $SSID -ifconfig $IFACE inet ${IP} ${OPT} up +ifconfig $IFACE create wlandev $WIFIDEV $CLONEOPTS wlanmode sta || 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 + if [ "$IP" = "auto" ]; then + dhclient $IFACE + else + ifconfig $IFACE inet $IP + fi +fi +if [ -n "$IP6" ]; then + if [ "$IP" = "auto" ]; then + ifconfig $IFACE accept_rtadv + else + ifconfig $IFACE inet6 $IP6 + fi +fi +ifconfig $IFACE $OPTS up [ -x /etc/sysctl.$IFACE ] && /etc/sysctl.$IFACE