hostapd start and stop

This commit is contained in:
Bob Mottram 2016-10-07 18:26:38 +01:00
parent fa555ce44b
commit 22f5ececf8
1 changed files with 4 additions and 2 deletions

View File

@ -145,6 +145,7 @@ function stop {
ifconfig $EIFACE down -promisc
fi
if [ $IFACE_SECONDARY ]; then
systemctl stop hostapd
brctl delif $BRIDGE_HOTSPOT bat0
ifconfig $BRIDGE_HOTSPOT down || true
brctl delbr $BRIDGE_HOTSPOT
@ -287,7 +288,7 @@ function start {
sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
echo "interface=$IFACE_SECONDARY" > /etc/hostapd/hostapd.conf
echo "interface=${IFACE_SECONDARY}" > /etc/hostapd/hostapd.conf
echo "bridge=${BRIDGE_HOTSPOT}" >> /etc/hostapd/hostapd.conf
echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
echo "country_code=UK" >> /etc/hostapd/hostapd.conf
@ -305,7 +306,8 @@ function start {
ifconfig $BRIDGE_HOTSPOT up
avahi-autoipd --force-bind --daemonize --wait $BRIDGE_HOTSPOT
ifconfig $IFACE_SECONDARY up promisc
ifconfig $IFACE_SECONDARY auto-dhcp start
#ifconfig $IFACE_SECONDARY auto-dhcp start
systemctl start hostapd
fi
fi
fi