mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
update iiab-hotspot-on|off
This commit is contained in:
parent
9a55fdff9c
commit
664b540fdb
3 changed files with 9 additions and 3 deletions
|
@ -15,6 +15,7 @@ RemainAfterExit=yes
|
||||||
ExecStartPre=-/sbin/iw phy phy0 interface add ap0 type __ap
|
ExecStartPre=-/sbin/iw phy phy0 interface add ap0 type __ap
|
||||||
ExecStartPre=-/sbin/ip link set ap0 address {{ ap0_mac_addr }}
|
ExecStartPre=-/sbin/ip link set ap0 address {{ ap0_mac_addr }}
|
||||||
ExecStart=-/sbin/ip link set ap0 up
|
ExecStart=-/sbin/ip link set ap0 up
|
||||||
|
ExecStop=-/sbin/iw dev ap0 del
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -17,12 +17,16 @@ 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
|
systemctl disable hostapd
|
||||||
systemctl stop hostapd
|
systemctl stop hostapd
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||||
echo " IIAB hotspot access point Disabled"
|
|
||||||
{% if wifi_up_down %}
|
{% 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
|
exit 0
|
||||||
{% else %}
|
{% else %}
|
||||||
sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
{% 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
|
||||||
|
@ -23,13 +22,15 @@ sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
systemctl enable hostapd
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
{% if wifi_up_down %}
|
{% if wifi_up_down %}
|
||||||
|
systemctl enable clone-wifi.service
|
||||||
|
systemctl enable wifi-test.service
|
||||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||||
exit 0
|
exit 0
|
||||||
{% else %}
|
{% else %}
|
||||||
sed -i -e "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
sed -i -e "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
||||||
|
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 %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue