forked from FreedomBen/rtl8188ce-linux-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_fixed_datarate.sh
More file actions
executable file
·48 lines (39 loc) · 878 Bytes
/
Copy pathset_fixed_datarate.sh
File metadata and controls
executable file
·48 lines (39 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
RATE=24M
INTF=''
wireless_interfaces ()
{
echo $(iwconfig 2>&1 | grep 'IEEE' | awk '{print $1}' | xargs)
}
wi_count ()
{
echo $(wireless_interfaces | wc -w)
}
set_fixed_rate ()
{
sudo iwconfig $1 rate fixed
sudo iwconfig $1 rate $RATE
sudo iwconfig $1 bit fixed
sudo iwconfig $1 bit $RATE
echo "$1 rate set to $RATE"
}
if [ -n "$1" ]; then
RATE="$1"
fi
if [ "$(wi_count)" = "0" ]; then
echo "Sorry, I couldn't find any wireless interfaces" >&2
elif [ "$(wi_count)" != "1" ]; then
echo "You have $(wi_count) wireless interfaces."
read -p "Use which I/F? (leave blank to use all): " INF
if [ -n "$INF" ]; then
INTF="$INF"
fi
fi
echo "Setting fixed rate to $RATE"
if [ -z "$INTF" ]; then
for i in "$(wireless_interfaces)"; do
set_fixed_rate "$i"
done
else
set_fixed_rate "$INTF"
fi