1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

revert hotspot on/off to master before ap0 when wifi_up_down is false

This commit is contained in:
George Hunt 2020-04-12 17:43:20 +01:00 committed by Jerry Vonau
parent ab0cb6fc90
commit 207cc98255
2 changed files with 16 additions and 13 deletions

View file

@ -6,22 +6,23 @@ echo " If you want hotspot on/off function please set wifi_up_down and run /opt
exit 0
{% else %}
#sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
# hotspot-off before ap0_updown
sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
systemctl disable hostapd
systemctl stop hostapd
#systemctl disable dnsmasq
#systemctl stop dnsmasq
#systemctl daemon-reload
#systemctl restart dhcpcd
systemctl daemon-reload
systemctl restart dhcpcd
#systemctl restart networking 6/15/2019 TFM removed
# Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease"
# Set wlan0 to promiscuous when AP's OFF (for possible WiFi gateway)
# SEE ALSO iiab-hotspot-on + /usr/libexec/iiab-startup.sh
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
#if grep -qi raspbian /etc/*release; then
# ip link set dev wlan0 promisc on
#fi
if grep -qi raspbian /etc/*release; then
ip link set dev wlan0 promisc on
fi
{% endif %}
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}

View file

@ -6,13 +6,15 @@ echo " If you want hotspot on/off function please set wifi_up_down and run /opt
exit 0
{% else %}
#cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
#sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
# just do what we have always done in hotspot-on
cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
# shut down wlan0 in case connected to network
#ip link set wlan0 down
ip link set wlan0 down
systemctl enable hostapd
#systemctl daemon-reload
#systemctl restart dhcpcd
systemctl daemon-reload
systemctl restart dhcpcd
systemctl start hostapd
systemctl start dnsmasq
@ -20,9 +22,9 @@ systemctl start dnsmasq
# Disable "promiscuous" on wlan0 when AP (i.e. no WiFi gateway)
# SEE ALSO iiab-hotspot-off + /usr/libexec/iiab-startup.sh
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
#if grep -qi raspbian /etc/*release; then
# ip link set dev wlan0 promisc off
#fi
if grep -qi raspbian /etc/*release; then
ip link set dev wlan0 promisc off
fi
{% endif %}
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}