mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
disable hostspot on/off if up/down enabled
This commit is contained in:
parent
640dbd64ea
commit
ab0cb6fc90
2 changed files with 16 additions and 0 deletions
|
@ -1,4 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
{% if wifi_up_down %}
|
||||
echo "Iiab-hotspot-up/down only functions when /etc/iiab/wifi_up_down is set to False"
|
||||
echo " If you want hotspot on/off function please set wifi_up_down and run /opt/iiab/iiab/iiab-network"
|
||||
exit 0
|
||||
|
||||
{% else %}
|
||||
#sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
||||
systemctl disable hostapd
|
||||
systemctl stop hostapd
|
||||
|
@ -15,5 +22,6 @@ systemctl stop hostapd
|
|||
#if grep -qi raspbian /etc/*release; then
|
||||
# ip link set dev wlan0 promisc on
|
||||
#fi
|
||||
{% endif %}
|
||||
|
||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
{% if wifi_up_down %}
|
||||
echo "Iiab-hotspot-up/down only functions when /etc/iiab/wifi_up_down is set to False"
|
||||
echo " If you want hotspot on/off function please set wifi_up_down and run /opt/iiab/iiab/iiab-network"
|
||||
exit 0
|
||||
|
||||
{% else %}
|
||||
#cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||
#sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
||||
# shut down wlan0 in case connected to network
|
||||
|
@ -16,6 +23,7 @@ systemctl start dnsmasq
|
|||
#if grep -qi raspbian /etc/*release; then
|
||||
# ip link set dev wlan0 promisc off
|
||||
#fi
|
||||
{% endif %}
|
||||
|
||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue