mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +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
|
#!/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
|
#sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
||||||
systemctl disable hostapd
|
systemctl disable hostapd
|
||||||
systemctl stop hostapd
|
systemctl stop hostapd
|
||||||
|
@ -15,5 +22,6 @@ systemctl stop hostapd
|
||||||
#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
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
#!/bin/bash
|
#!/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
|
#cp -f /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||||
#sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
#sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
||||||
# shut down wlan0 in case connected to network
|
# shut down wlan0 in case connected to network
|
||||||
|
@ -16,6 +23,7 @@ systemctl start dnsmasq
|
||||||
#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
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue