--- elwix/config/etc/default/rc.d/011.dwds_relay.stop 2011/07/05 23:43:00 1.1 +++ elwix/config/etc/default/rc.d/011.dwds_relay.stop 2017/02/13 16:52:47 1.3 @@ -2,38 +2,59 @@ IFACE="wlan0" WIFIDEV="ath0" +CLONEOPTS="" REGDOMAIN="" COUNTRY="" SSID="relay-dwds" CHAN="36:a" -SPEED="" -WIFIOPTS="-apbridge" +BINT="100" +WIFIOPTS="-apbridge -bgscan" -OPT="" +OPTS="" IP="172.31.1.1/30" +IP6="" -[ -r /etc/rc.wifi ] && . /etc/rc.wifi +DWDS_CLI="/etc/rc.S/011.dwds_cli.run" -echo "Config wirelss DWDS-Relay interface $IFACE ..." +[ -z "$IFACE" -o -z "$WIFIDEV" ] && exit -if [ ! -x /etc/rc.d/011.dwds_cli.run ]; then - echo "Error:: Can't start DWDS-Relay, because DWDS-Client not configured!" +echo "Config wirelss DWDS (Relay) interface $IFACE ..." + +if [ ! -x "$DWDS_CLI" ]; then + echo "Error:: Can't start DWDS (Relay), because DWDS (Client) not configured!" exit 1 else - /etc/rc.d/011.dwds_cli.run + eval "$DWDS_CLI" fi -createwlan $IFACE $WIFIDEV hostap -regdomain $IFACE $REGDOMAIN -country $IFACE $COUNTRY -speedset $IFACE $SPEED -setwifiopts $IFACE $WIFIOPTS -setchan $IFACE $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 +if [ -n "$IP6" ]; then + ifconfig $IFACE inet6 $IP6 +fi +ifconfig $IFACE $OPTS up [ -x /etc/sysctl.$IFACE ] && /etc/sysctl.$IFACE