hostapd start and stop
This commit is contained in:
parent
fa555ce44b
commit
22f5ececf8
|
@ -145,6 +145,7 @@ function stop {
|
||||||
ifconfig $EIFACE down -promisc
|
ifconfig $EIFACE down -promisc
|
||||||
fi
|
fi
|
||||||
if [ $IFACE_SECONDARY ]; then
|
if [ $IFACE_SECONDARY ]; then
|
||||||
|
systemctl stop hostapd
|
||||||
brctl delif $BRIDGE_HOTSPOT bat0
|
brctl delif $BRIDGE_HOTSPOT bat0
|
||||||
ifconfig $BRIDGE_HOTSPOT down || true
|
ifconfig $BRIDGE_HOTSPOT down || true
|
||||||
brctl delbr $BRIDGE_HOTSPOT
|
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
|
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 "bridge=${BRIDGE_HOTSPOT}" >> /etc/hostapd/hostapd.conf
|
||||||
echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
|
echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
|
||||||
echo "country_code=UK" >> /etc/hostapd/hostapd.conf
|
echo "country_code=UK" >> /etc/hostapd/hostapd.conf
|
||||||
|
@ -305,7 +306,8 @@ function start {
|
||||||
ifconfig $BRIDGE_HOTSPOT up
|
ifconfig $BRIDGE_HOTSPOT up
|
||||||
avahi-autoipd --force-bind --daemonize --wait $BRIDGE_HOTSPOT
|
avahi-autoipd --force-bind --daemonize --wait $BRIDGE_HOTSPOT
|
||||||
ifconfig $IFACE_SECONDARY up promisc
|
ifconfig $IFACE_SECONDARY up promisc
|
||||||
ifconfig $IFACE_SECONDARY auto-dhcp start
|
#ifconfig $IFACE_SECONDARY auto-dhcp start
|
||||||
|
systemctl start hostapd
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue