mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
dhcpcd hook refinements
This commit is contained in:
parent
7fd6fc9737
commit
25bd5a9b3c
1 changed files with 17 additions and 3 deletions
|
@ -6,9 +6,23 @@ if [ "$interface" = "wlan0" ]; then
|
||||||
# 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`
|
||||||
syslog info "40-iiab set channel $FREQ"
|
FREQ2=""
|
||||||
sed -i -e "s/^channel.*/channel=$FREQ /" /etc/hostapd/hostapd.conf
|
for result in $FREQ; do
|
||||||
# will need a reboot for hostapd if the channel changed
|
echo "frequency is $result for carrier"
|
||||||
|
if [ $result -lt 13 ]; then
|
||||||
|
FREQ2=$result
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Using $FREQ2 for $SSID"
|
||||||
|
syslog info "50-iiab set channel $FREQ2"
|
||||||
|
HOSTAPD=`grep channel /etc/hostapd/hostapd.conf | awk -F = '{print $2}'`
|
||||||
|
echo "Hostapd set for $HOSTAPD"
|
||||||
|
if [ $FREQ2 -ne $HOSTAPD ] && [ ! -z $FREQ2 ]; then
|
||||||
|
echo "Editing Hostapd for channel $FREQ2"
|
||||||
|
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||||
|
sed -i -e "s/^channel.*/channel=$FREQ /" /etc/hostapd/hostapd.conf
|
||||||
|
# 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