1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00

on|off for wifi_up_down

This commit is contained in:
Jerry Vonau 2020-04-13 04:33:38 -05:00
parent 207cc98255
commit 13d7c38a73
2 changed files with 16 additions and 14 deletions

View file

@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
{% if wifi_up_down %} {% if wifi_up_down %}
echo "Iiab-hotspot-up/down only functions when /etc/iiab/wifi_up_down is set to False" systemctl disable hostapd
echo " If you want hotspot on/off function please set wifi_up_down and run /opt/iiab/iiab/iiab-network" systemctl stop hostapd
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
echo " IIAB hotspot access point Disabled"
exit 0 exit 0
{% else %} {% else %}
@ -15,14 +17,13 @@ systemctl stop hostapd
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
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
# 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 }}

View file

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
{% if wifi_up_down %} {% if wifi_up_down %}
echo "Iiab-hotspot-up/down only functions when /etc/iiab/wifi_up_down is set to False" systemctl enable hostapd
echo " If you want hotspot on/off function please set wifi_up_down and run /opt/iiab/iiab/iiab-network" sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0 exit 0
{% else %} {% else %}
@ -17,16 +18,16 @@ systemctl daemon-reload
systemctl restart dhcpcd systemctl restart dhcpcd
systemctl start hostapd systemctl start hostapd
systemctl start dnsmasq systemctl start dnsmasq
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
# Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease" # Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease"
# 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 }}
echo -e "\nPlease consider rebooting now.\n" echo -e "\nPlease consider rebooting now.\n"