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