1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/network/templates/hostapd/50-hostapd
2020-05-01 10:27:45 -05:00

12 lines
458 B
Text

if [ "$interface" = "wlan0" ]; then
syslog info "50-hostapd-ap0"
sleep 2
# 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' ' -f2`
sed -i -e "s/^frequency.*/channel=$FREQ /" /etc/hostapd/hostapd.conf
syslog info "50-hostapd restarting hostapd"
systemctl daemon-reload
systemctl restart hostapd
fi