mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
revert hotspot on/off to master before ap0 when wifi_up_down is false
This commit is contained in:
parent
ab0cb6fc90
commit
207cc98255
2 changed files with 16 additions and 13 deletions
|
@ -6,22 +6,23 @@ echo " If you want hotspot on/off function please set wifi_up_down and run /opt
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
{% else %}
|
{% 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 disable hostapd
|
||||||
systemctl stop hostapd
|
systemctl stop hostapd
|
||||||
#systemctl disable dnsmasq
|
#systemctl disable dnsmasq
|
||||||
#systemctl stop dnsmasq
|
#systemctl stop dnsmasq
|
||||||
#systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
#systemctl restart dhcpcd
|
systemctl restart dhcpcd
|
||||||
#systemctl restart networking 6/15/2019 TFM removed
|
#systemctl restart networking 6/15/2019 TFM removed
|
||||||
|
|
||||||
# Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease"
|
# Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease"
|
||||||
# Set wlan0 to promiscuous when AP's OFF (for possible WiFi gateway)
|
# Set wlan0 to promiscuous when AP's OFF (for possible WiFi gateway)
|
||||||
# SEE ALSO iiab-hotspot-on + /usr/libexec/iiab-startup.sh
|
# SEE ALSO iiab-hotspot-on + /usr/libexec/iiab-startup.sh
|
||||||
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
|
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
|
||||||
#if grep -qi raspbian /etc/*release; then
|
if grep -qi raspbian /etc/*release; then
|
||||||
# ip link set dev wlan0 promisc on
|
ip link set dev wlan0 promisc on
|
||||||
#fi
|
fi
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||||
|
|
|
@ -6,13 +6,15 @@ echo " If you want hotspot on/off function please set wifi_up_down and run /opt
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
#cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
# just do what we have always done in hotspot-on
|
||||||
#sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
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
|
# shut down wlan0 in case connected to network
|
||||||
#ip link set wlan0 down
|
ip link set wlan0 down
|
||||||
systemctl enable hostapd
|
systemctl enable hostapd
|
||||||
#systemctl daemon-reload
|
#systemctl daemon-reload
|
||||||
#systemctl restart dhcpcd
|
systemctl daemon-reload
|
||||||
|
systemctl restart dhcpcd
|
||||||
systemctl start hostapd
|
systemctl start hostapd
|
||||||
systemctl start dnsmasq
|
systemctl start dnsmasq
|
||||||
|
|
||||||
|
@ -20,9 +22,9 @@ systemctl start dnsmasq
|
||||||
# Disable "promiscuous" on wlan0 when AP (i.e. no WiFi gateway)
|
# Disable "promiscuous" on wlan0 when AP (i.e. no WiFi gateway)
|
||||||
# SEE ALSO iiab-hotspot-off + /usr/libexec/iiab-startup.sh
|
# SEE ALSO iiab-hotspot-off + /usr/libexec/iiab-startup.sh
|
||||||
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
|
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
|
||||||
#if grep -qi raspbian /etc/*release; then
|
if grep -qi raspbian /etc/*release; then
|
||||||
# ip link set dev wlan0 promisc off
|
ip link set dev wlan0 promisc off
|
||||||
#fi
|
fi
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue