mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
wip on the fly
This commit is contained in:
parent
8924b6668c
commit
ed2a0f3027
1 changed files with 12 additions and 0 deletions
|
@ -12,6 +12,9 @@ if [ "$interface" = "wlan0" ]; then
|
|||
# FREQ=`iw wlan0 info|grep channel|cut -d' ' -f9`
|
||||
FREQ=`iw wlan0 info|grep channel|cut -d' ' -f2`
|
||||
FREQ2=""
|
||||
WPA=`grep country /etc/wpa_supplicant/wpa_supplicant.conf | awk -F = '{print $2}'`
|
||||
AP=`grep country_code /etc/hostapd/hostapd.conf | awk -F = '{print $2}'`
|
||||
|
||||
for result in $FREQ; do
|
||||
echo "frequency is $result for carrier"
|
||||
if [ $result -lt 13 ]; then
|
||||
|
@ -32,6 +35,15 @@ if [ "$interface" = "wlan0" ]; then
|
|||
syslog info "THIS MACHINE SHOULD BE REBOOTED"
|
||||
# systemctl restart hostapd
|
||||
fi
|
||||
if ! [ "$WPA" = "$AP" ]; then
|
||||
sed -i -e "s/^country_code.*/country_code=$WPA /" /etc/hostapd/hostapd.conf
|
||||
echo "50-iiab set country_code $WPA"
|
||||
syslog info "50-iiab set country_code $WPA"
|
||||
echo "THIS MACHINE SHOULD BE REBOOTED"
|
||||
syslog info "THIS MACHINE SHOULD BE REBOOTED"
|
||||
# systemctl restart hostapd
|
||||
fi
|
||||
|
||||
fi
|
||||
# spams the logging
|
||||
#syslog info "50-iiab set ap0 spam $REASON"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue