mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
44 lines
1.5 KiB
Bash
Executable file
44 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
{% if not network_enabled %}
|
|
echo -e "Networking role disabled\n"
|
|
echo -e "For details, see: https://github.com/iiab/iiab/pull/3302\n"
|
|
{% else %}
|
|
sed -i "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
|
systemctl disable hostapd
|
|
systemctl stop hostapd
|
|
{% if wifi_up_down %}
|
|
systemctl disable iiab-clone-wifi.service
|
|
systemctl disable iiab-wifi-test.service
|
|
systemctl stop iiab-clone-wifi.service
|
|
echo " IIAB hotspot access point Disabled"
|
|
#exit 0
|
|
{% else %}
|
|
echo " IIAB hotspot access point Disabled"
|
|
{% if is_raspbian %}
|
|
# hotspot-off before ap0_updown
|
|
sed -i "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
|
#systemctl disable dnsmasq
|
|
#systemctl stop dnsmasq
|
|
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
|
|
{% else %}
|
|
#ubuntu (or Mint, or pure Debian?)
|
|
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
|
sed -i "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
|
fi
|
|
echo -e "\nIf you're enabling upstream WiFi, please reboot now.\n"
|
|
#exit 0
|
|
{% endif %}
|
|
#is_raspbian
|
|
{% endif %}
|
|
#wifi_up_down
|
|
{% endif %}
|
|
#network_enabled
|