mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
clean up netd-disp2
This commit is contained in:
parent
ba9e9ee01a
commit
088537b9b8
1 changed files with 3 additions and 8 deletions
|
@ -2,20 +2,15 @@
|
|||
if [ "$IFACE" == "{{ discovered_wireless_iface }}" ]; then
|
||||
echo "NET-DISP-WiFi $IFACE $STATE"
|
||||
# If we are here we have a dhcp ip address
|
||||
CHAN=`iw $IFACE info|grep channel|cut -d' ' -f2`
|
||||
CHAN=$(iw "$IFACE" info|grep channel|cut -d' ' -f2)
|
||||
echo "Using channel $CHAN for carrier"
|
||||
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"
|
||||
if [ $CHAN -ne $HOSTAPD ] && [ $CHAN -lt 14 ]; then
|
||||
echo "Editing Hostapd for channel $CHAN"
|
||||
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||
sed -i -e "s/^channel.*/channel=$CHAN/" /etc/hostapd/hostapd.conf
|
||||
systemctl stop wpa_supplicant
|
||||
sed -i "s/^channel.*/channel=$CHAN/" /etc/hostapd/hostapd.conf
|
||||
systemctl restart hostapd
|
||||
systemctl start wpa_supplicant
|
||||
if [ -f /run/netplan/wpa-$IFACE.conf ]; then
|
||||
systemctl restart netplan-wpa-$IFACE.service
|
||||
fi
|
||||
else
|
||||
echo "Upstream Channel greater than 13 or is the same - not changing hostapd.conf"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue