--- elwix/config/etc/default/rc.wifi 2011/07/05 23:43:00 1.1 +++ elwix/config/etc/default/rc.wifi 2011/11/02 09:51:32 1.2 @@ -1,112 +1,9 @@ # Common loader functions for WIFI boot scripts # (C)`09 AITNET ltd - Sofia/Bulgaria # -# $Id: rc.wifi,v 1.1 2011/07/05 23:43:00 misho Exp $ +# $Id: rc.wifi,v 1.2 2011/11/02 09:51:32 misho Exp $ -# regdomain() [additional options] -regdomain() -{ - if [ $# -ne 2 ]; then - echo "regdomain() Not enough parameters ..." - return 1 - fi - - if [ X"$2" != X"" ]; then - else - ifconfig $1 regdomain $2 - fi - - if [ $# -gt 2 ]; then - shift 2 - ifconfig $1 $* - fi -} - -# country() -country() -{ - if [ $# -ne 2 ]; then - echo "country() Not enough parameters ..." - return 1 - fi - - if [ X"$2" != X"" ]; then - else - ifconfig $1 country $2 - fi -} - -# speedset() [mcast_speed] [mgmt_speed] -speedset() -{ - if [ $# -lt 2 ]; then - echo "setspeed() Not enough parameters ..." - return 1 - fi - - if [ X"$2" != X"" ]; then - return 0 - fi - - ARGS="ucastrate $2" - if [ $# -gt 2 ]; then - ARGS=$ARGS" mcastrate $3" - fi - if [ $# -gt 3 ]; then - ARGS=$ARGS" mgtrate $4" - fi - - ifconfig $1 $ARGS -} - -# createwlan() [wdsbssid] -createwlan() -{ - if [ $# -lt 3 ]; then - echo "createwlan() Not enough parameters ..." - return 1 - fi - - ARGS="create wlandev $2 wlanmode $3" - if [ $# -gt 3 ]; then - shift 3 - ARGS=$ARGS" $*" - fi - - ifconfig $1 $ARGS -} - -# setchan() [mode] -setchan() -{ - if [ $# -lt 2 ]; then - echo "setchan() Not enough parameters ..." - return 1 - fi - - ARGS="channel $2" - if [ $# -gt 2 ]; then - ARGS=$ARGS" mode $3" - fi - - ifconfig $1 $ARGS -} - -# setwifiopts() -setwifiopts() -{ - if [ $# -lt 1 ]; then - echo "setwifiopts() Not enough parameters ..." - return 1 - fi - - if [ $# -gt 1 ]; then - shift 1 - ifconfig $1 $* - fi -} - # setWEP() [key2] [key3] [key4] setWEP() { @@ -115,7 +12,7 @@ setWEP() return 1 fi - ARGS="wep deftxkey $2 wepkey 1:$3" + ARGS="authmode open wepmode on deftxkey $2 wepkey 1:$3" if [ $# -gt 3 ]; then ARGS=$ARGS" wepkey 2:$4" fi