1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00
This commit is contained in:
Jerry Vonau 2020-04-30 00:58:24 -05:00
parent 7307962067
commit 5dd283f84e
2 changed files with 26 additions and 20 deletions

View file

@ -1,13 +1,5 @@
#!/bin/bash
{% if wifi_up_down %}
systemctl disable hostapd
systemctl stop hostapd
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
echo " IIAB hotspot access point Disabled"
exit 0
{% else %}
{% if is_raspbian %}
# hotspot-off before ap0_updown
sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
systemctl disable hostapd
@ -18,7 +10,6 @@ systemctl daemon-reload
systemctl restart dhcpcd
#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"
# Set wlan0 to promiscuous when AP's OFF (for possible WiFi gateway)
# SEE ALSO iiab-hotspot-on + /usr/libexec/iiab-startup.sh
@ -26,4 +17,16 @@ sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
#if grep -qi raspbian /etc/*release; then
# ip link set dev wlan0 promisc on
#fi
{% else %}
systemctl disable hostapd
systemctl stop hostapd
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
echo " IIAB hotspot access point Disabled"
{% if wifi_up_down %}
exit 0
{% else %}
sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
echo -e "\nPlease reboot to enable upstream WiFi access.\n"
exit 0
{% endif %}
{% endif %}

View file

@ -1,12 +1,6 @@
#!/bin/bash
{% if wifi_up_down %}
systemctl enable hostapd
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0
{% else %}
{% if is_raspbian %}
# 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
@ -20,7 +14,6 @@ systemctl start hostapd
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"
# Disable "promiscuous" on wlan0 when AP (i.e. no WiFi gateway)
# SEE ALSO iiab-hotspot-off + /usr/libexec/iiab-startup.sh
@ -28,6 +21,16 @@ sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
#if grep -qi raspbian /etc/*release; then
# ip link set dev wlan0 promisc off
#fi
{% endif %}
echo -e "\nPlease consider rebooting now.\n"
{% else %}
systemctl enable hostapd
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
{% if wifi_up_down %}
echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0
{% else %}
sed -i -e "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0
{% endif %}
{% endif %}