mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
update dhcpcd hook
This commit is contained in:
parent
3f749036e4
commit
0bcf3c8184
1 changed files with 17 additions and 9 deletions
|
@ -1,12 +1,20 @@
|
|||
|
||||
if [ "$interface" = "wlan0" ]; then
|
||||
syslog info "50-hostapd-ap0"
|
||||
sleep 2
|
||||
REASON="$reason"
|
||||
if [ "$reason" = "CARRIER" ]; then
|
||||
syslog info "50-iiab CARRIER change wlan0"
|
||||
# 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
|
||||
syslog info "40-iiab set channel $FREQ"
|
||||
sed -i -e "s/^channel.*/channel=$FREQ /" /etc/hostapd/hostapd.conf
|
||||
# will need a reboot for hostapd if the channel changed
|
||||
fi
|
||||
# spams the logging
|
||||
#syslog info "50-iiab set ap0 spam $REASON"
|
||||
if [ -e /sys/class/net/ap0 ] && ! [ "$reason" = "ROUTERADVERT" ]; then
|
||||
syslog info "50-iiab set ap0 up $REASON"
|
||||
# keeps ap0 up so hostapd works
|
||||
ip link set ap0 up
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue