1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

hotspots revised

This commit is contained in:
Jerry Vonau 2020-05-06 10:14:25 -05:00
parent 35efbe8ea8
commit 0024a0c17f
2 changed files with 28 additions and 23 deletions

View file

@ -1,4 +1,14 @@
#!/bin/bash #!/bin/bash
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
systemctl disable hostapd
systemctl stop hostapd
{% if wifi_up_down %}
systemctl disable clone-wifi.service
systemctl disable wifi-test.service
systemctl stop clone-wifi.service
echo " IIAB hotspot access point Disabled"
exit 0
{% else %}
{% if is_raspbian %} {% if is_raspbian %}
# hotspot-off before ap0_updown # hotspot-off before ap0_updown
sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
@ -9,7 +19,6 @@ 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
@ -17,20 +26,13 @@ sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
#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
{% else %} {% else %}
systemctl disable hostapd #ubuntu
systemctl stop hostapd if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }} sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
{% if wifi_up_down %} fi
systemctl disable clone-wifi.service
systemctl disable wifi-test.service
systemctl stop clone-wifi.service
echo " IIAB hotspot access point Disabled"
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" echo -e "\nPlease reboot to enable upstream WiFi access.\n"
exit 0 exit 0
{% endif %} {% endif %}
#wifi_up_down
{% endif %} {% endif %}

View file

@ -1,4 +1,12 @@
#!/bin/bash #!/bin/bash
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
{% if wifi_up_down %}
systemctl enable clone-wifi.service
systemctl enable hostapd
systemctl enable wifi-test.service
echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0
{% else %}
{% if is_raspbian %} {% if is_raspbian %}
# just do what we have always done in hotspot-on # just do what we have always done in hotspot-on
cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
@ -11,7 +19,6 @@ 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)
@ -20,18 +27,14 @@ sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
#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
{% else %} {% else %}
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }} #ubuntu
{% if wifi_up_down %} if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]
systemctl enable clone-wifi.service sed -i -e "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
systemctl enable wifi-test.service fi
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
systemctl enable hostapd systemctl enable hostapd
echo -e "\nPlease reboot to activate hostapd feature.\n" echo -e "\nPlease reboot to activate hostapd feature.\n"
exit 0 exit 0
{% endif %} {% endif %}
#wifi_up_down
{% endif %} {% endif %}