version 1.1.1.1, 2011/07/05 23:43:00
|
version 1.1.1.1.4.2, 2011/10/31 13:33:46
|
Line 4
|
Line 4
|
# $Id$ |
# $Id$ |
|
|
|
|
# regdomain() <iface> <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() <iface> <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() <iface> <ucast_speed> [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() <iface> <wlandev> <ap|sta|adhoc|tdma|wds|mesh> [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() <iface> <channel> [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() <iface> <wifiopts> |
|
setwifiopts() |
|
{ |
|
if [ $# -lt 1 ]; then |
|
echo "setwifiopts() Not enough parameters ..." |
|
return 1 |
|
fi |
|
|
|
if [ $# -gt 1 ]; then |
|
shift 1 |
|
ifconfig $1 $* |
|
fi |
|
} |
|
|
|
# setWEP() <iface> <default_key> <key1> [key2] [key3] [key4] |
# setWEP() <iface> <default_key> <key1> [key2] [key3] [key4] |
setWEP() |
setWEP() |
{ |
{ |
Line 115 setWEP()
|
Line 12 setWEP()
|
return 1 |
return 1 |
fi |
fi |
|
|
ARGS="wep deftxkey $2 wepkey 1:$3" | ARGS="authmode open wepmode on deftxkey $2 wepkey 1:$3" |
if [ $# -gt 3 ]; then |
if [ $# -gt 3 ]; then |
ARGS=$ARGS" wepkey 2:$4" |
ARGS=$ARGS" wepkey 2:$4" |
fi |
fi |