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/ip link set ap0 address {{ ap0_mac_addr }}
|
||||
ExecStart=-/sbin/ip link set ap0 up
|
||||
ExecStop=-/sbin/iw dev ap0 del
|
||||
|
||||
[Install]
|
||||
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
|
||||
# ip link set dev wlan0 promisc on
|
||||
#fi
|
||||
|
||||
{% else %}
|
||||
systemctl disable hostapd
|
||||
systemctl stop hostapd
|
||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||
echo " IIAB hotspot access point Disabled"
|
||||
{% 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
|
||||
{% else %}
|
||||
sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
{% if is_raspbian %}
|
||||
# just do what we have always done in hotspot-on
|
||||
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
|
||||
|
||||
{% else %}
|
||||
systemctl enable hostapd
|
||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||
{% if wifi_up_down %}
|
||||
systemctl enable clone-wifi.service
|
||||
systemctl enable wifi-test.service
|
||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||
exit 0
|
||||
{% else %}
|
||||
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"
|
||||
exit 0
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue