1 | 3 | czfcentos | #!/bin/bash |
2 | | | # Petr Simandl www.simandl.cz |
3 | | | # prepinani anten pro atheros |
4 | | | |
5 | | | if [ "$1 x" = " x" ] |
6 | | | then |
7 | | | echo "usage : athant [ath0|ath1|ath2|wifi0|wifi1|wifi2] [0|1|2]" |
8 | | | echo " 0.. diversity 1.. antenna 1 2.. antenna 2" |
9 | | | exit 1 |
10 | | | fi |
11 | | | |
12 | | | case $2 in |
13 | | | 0) |
14 | | | # /bin/echo "zapinam diversity pro $1" |
15 | | | echo 1 > /proc/sys/dev/$1/rxantenna |
16 | | | echo 0 > /proc/sys/dev/$1/txantenna |
17 | | | echo 1 > /proc/sys/dev/$1/diversity |
18 | | | ;; |
19 | | | 1) |
20 | | | # echo "antena 1 pro $1" |
21 | | | echo 1 > /proc/sys/dev/$1/rxantenna |
22 | | | echo 1 > /proc/sys/dev/$1/txantenna |
23 | | | echo 0 > /proc/sys/dev/$1/diversity |
24 | | | ;; |
25 | | | 2) |
26 | | | # echo "antena 2 pro $1" |
27 | | | echo 2 > /proc/sys/dev/$1/rxantenna |
28 | | | echo 2 > /proc/sys/dev/$1/txantenna |
29 | | | echo 0 > /proc/sys/dev/$1/diversity |
30 | | | ;; |
31 | | | *) |
32 | | | echo -n "div " |
33 | | | cat /proc/sys/dev/$1/diversity |
34 | | | echo -n "txa " |
35 | | | cat /proc/sys/dev/$1/txantenna |
36 | | | echo -n "rxa " |
37 | | | cat /proc/sys/dev/$1/rxantenna |
38 | | | esac |