aredn/files/usr/local/bin/wifi-onbootchains

39 lines
1.2 KiB
Perl
Executable File

#!/usr/bin/perl -w -I/www/cgi-bin
=for commnet
Part of BBHN Mesh -- Used for creating Amateur Radio friendly mesh networks
Copyright (C) 2015 Conrad Lara
See Contributors file for additional contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
=cut
use perlfunc;
if (wifi_useschains()){
$wifi_rxant = `uci -q get wireless.\@wifi-device[0].rxchain`;
$wifi_txant = `uci -q get wireless.\@wifi-device[0].txchain`;
chomp($wifi_rxant);
chomp($wifi_txant);
if ( $wifi_rxant ne "" ) {
`echo $wifi_rxant > /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`;
}
if ( $wifi_txant ne "" ) {
`echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`;
}
}