2017-11-19 00:48:13 +00:00
|
|
|
#!/bin/bash
|
2022-09-22 22:30:04 +00:00
|
|
|
{% if not network_enabled %}
|
|
|
|
echo -e "Networking role disabled\n"
|
|
|
|
echo -e "For details, see: https://github.com/iiab/iiab/pull/3302\n"
|
|
|
|
{% else %}
|
2023-04-22 15:50:04 +00:00
|
|
|
sed -i "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
2020-05-06 15:14:25 +00:00
|
|
|
systemctl disable hostapd
|
|
|
|
systemctl stop hostapd
|
|
|
|
{% if wifi_up_down %}
|
2021-07-28 02:36:07 +00:00
|
|
|
systemctl disable iiab-clone-wifi.service
|
|
|
|
systemctl disable iiab-wifi-test.service
|
|
|
|
systemctl stop iiab-clone-wifi.service
|
2020-05-06 15:14:25 +00:00
|
|
|
echo " IIAB hotspot access point Disabled"
|
2023-04-22 13:59:29 +00:00
|
|
|
#exit 0
|
2020-05-06 15:14:25 +00:00
|
|
|
{% else %}
|
2023-04-22 14:06:54 +00:00
|
|
|
echo " IIAB hotspot access point Disabled"
|
2020-04-30 05:58:24 +00:00
|
|
|
{% if is_raspbian %}
|
2020-04-12 16:43:20 +00:00
|
|
|
# hotspot-off before ap0_updown
|
2023-04-22 15:50:04 +00:00
|
|
|
sed -i "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
2019-02-26 19:03:02 +00:00
|
|
|
#systemctl disable dnsmasq
|
|
|
|
#systemctl stop dnsmasq
|
2020-04-12 16:43:20 +00:00
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl restart dhcpcd
|
2019-06-15 19:16:56 +00:00
|
|
|
#systemctl restart networking 6/15/2019 TFM removed
|
2018-01-11 04:33:22 +00:00
|
|
|
# Temporary promiscuous-mode workaround for RPi's WiFi "10SEC disease"
|
2018-01-11 04:40:23 +00:00
|
|
|
# Set wlan0 to promiscuous when AP's OFF (for possible WiFi gateway)
|
2018-01-11 04:33:22 +00:00
|
|
|
# SEE ALSO iiab-hotspot-on + /usr/libexec/iiab-startup.sh
|
2018-01-05 04:28:43 +00:00
|
|
|
# https://github.com/iiab/iiab/issues/638#issuecomment-355455454
|
2020-04-13 09:33:38 +00:00
|
|
|
#if grep -qi raspbian /etc/*release; then
|
|
|
|
# ip link set dev wlan0 promisc on
|
|
|
|
#fi
|
2020-04-30 05:58:24 +00:00
|
|
|
{% else %}
|
2023-04-22 14:06:54 +00:00
|
|
|
#ubuntu (or Mint, or pure Debian?)
|
2020-10-24 14:01:41 +00:00
|
|
|
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
2023-04-22 15:50:04 +00:00
|
|
|
sed -i "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
2020-05-06 15:14:25 +00:00
|
|
|
fi
|
2023-04-22 13:59:29 +00:00
|
|
|
echo -e "\nIf you're enabling upstream WiFi, please reboot now.\n"
|
|
|
|
#exit 0
|
2020-04-30 05:58:24 +00:00
|
|
|
{% endif %}
|
2023-04-16 10:55:50 +00:00
|
|
|
#is_raspbian
|
2020-04-12 16:34:39 +00:00
|
|
|
{% endif %}
|
2023-04-16 10:55:50 +00:00
|
|
|
#wifi_up_down
|
2022-09-22 22:30:04 +00:00
|
|
|
{% endif %}
|
2023-04-16 10:55:50 +00:00
|
|
|
#network_enabled
|