mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
move country_code - replace '' with $()
This commit is contained in:
parent
743d8f2601
commit
a8ca92a9b3
1 changed files with 12 additions and 13 deletions
|
@ -1,4 +1,14 @@
|
||||||
if [ "$interface" = "br0" ] && [ $if_up = "true" ]; then
|
if [ "$interface" = "br0" ] && [ $if_up = "true" ]; then
|
||||||
|
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}')
|
||||||
|
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
|
||||||
syslog info "50-iiab IF_UP br0 restarting dnsmasq - kicking ap0"
|
syslog info "50-iiab IF_UP br0 restarting dnsmasq - kicking ap0"
|
||||||
ip link set ap0 up
|
ip link set ap0 up
|
||||||
systemctl --no-block restart dnsmasq
|
systemctl --no-block restart dnsmasq
|
||||||
|
@ -10,10 +20,8 @@ if [ "$interface" = "wlan0" ]; then
|
||||||
syslog info "50-iiab CARRIER change wlan0"
|
syslog info "50-iiab CARRIER change wlan0"
|
||||||
# wpa_supplicant wants MHz for frequency= while hostapd wants channel..... whatever
|
# wpa_supplicant wants MHz for frequency= while hostapd wants channel..... whatever
|
||||||
# FREQ=`iw wlan0 info|grep channel|cut -d' ' -f9`
|
# FREQ=`iw wlan0 info|grep channel|cut -d' ' -f9`
|
||||||
FREQ=`iw wlan0 info|grep channel|cut -d' ' -f2`
|
FREQ=$(iw wlan0 info|grep channel|cut -d' ' -f2)
|
||||||
FREQ2=""
|
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
|
for result in $FREQ; do
|
||||||
echo "frequency is $result for carrier"
|
echo "frequency is $result for carrier"
|
||||||
|
@ -25,7 +33,7 @@ if [ "$interface" = "wlan0" ]; then
|
||||||
done
|
done
|
||||||
echo "Using $FREQ2 for carrier"
|
echo "Using $FREQ2 for carrier"
|
||||||
syslog info "50-iiab set channel $FREQ2"
|
syslog info "50-iiab set channel $FREQ2"
|
||||||
HOSTAPD=`grep channel /etc/hostapd/hostapd.conf | awk -F = '{print $2}'`
|
HOSTAPD=$(grep channel /etc/hostapd/hostapd.conf | awk -F = '{print $2}')
|
||||||
echo "Hostapd set for $HOSTAPD"
|
echo "Hostapd set for $HOSTAPD"
|
||||||
if [ $FREQ2 -ne $HOSTAPD ] && [ ! -z $FREQ2 ]; then
|
if [ $FREQ2 -ne $HOSTAPD ] && [ ! -z $FREQ2 ]; then
|
||||||
echo "Editing Hostapd for channel $FREQ2"
|
echo "Editing Hostapd for channel $FREQ2"
|
||||||
|
@ -35,15 +43,6 @@ if [ "$interface" = "wlan0" ]; then
|
||||||
syslog info "THIS MACHINE SHOULD BE REBOOTED"
|
syslog info "THIS MACHINE SHOULD BE REBOOTED"
|
||||||
# systemctl restart hostapd
|
# systemctl restart hostapd
|
||||||
fi
|
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
|
fi
|
||||||
# spams the logging
|
# spams the logging
|
||||||
#syslog info "50-iiab set ap0 spam $REASON"
|
#syslog info "50-iiab set ap0 spam $REASON"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue