mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge branch 'reg_dom2+iiab-hotspot-off_etc' into reg_dom3
This commit is contained in:
commit
6fe64a9097
4 changed files with 44 additions and 17 deletions
15
adm-run-roles-tmp.yml
Normal file
15
adm-run-roles-tmp.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
vars_files:
|
||||||
|
- vars/default_vars.yml
|
||||||
|
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||||
|
- /etc/iiab/local_vars.yml
|
||||||
|
- /etc/iiab/iiab_state.yml
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- { role: 0-init }
|
||||||
|
- { role: captiveportal }
|
||||||
|
- { role: lokole }
|
||||||
|
- { role: network }
|
|
@ -3,7 +3,7 @@
|
||||||
echo -e "Networking role disabled\n"
|
echo -e "Networking role disabled\n"
|
||||||
echo -e "For details, see: https://github.com/iiab/iiab/pull/3302\n"
|
echo -e "For details, see: https://github.com/iiab/iiab/pull/3302\n"
|
||||||
{% else %}
|
{% else %}
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
sed -i "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||||
systemctl disable hostapd
|
systemctl disable hostapd
|
||||||
systemctl stop hostapd
|
systemctl stop hostapd
|
||||||
{% if wifi_up_down %}
|
{% if wifi_up_down %}
|
||||||
|
@ -11,13 +11,12 @@ systemctl disable iiab-clone-wifi.service
|
||||||
systemctl disable iiab-wifi-test.service
|
systemctl disable iiab-wifi-test.service
|
||||||
systemctl stop iiab-clone-wifi.service
|
systemctl stop iiab-clone-wifi.service
|
||||||
echo " IIAB hotspot access point Disabled"
|
echo " IIAB hotspot access point Disabled"
|
||||||
exit 0
|
#exit 0
|
||||||
{% else %}
|
{% else %}
|
||||||
|
echo " IIAB hotspot access point Disabled"
|
||||||
{% if is_raspbian %}
|
{% if is_raspbian %}
|
||||||
# hotspot-off before ap0_updown
|
# hotspot-off before ap0_updown
|
||||||
sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
sed -i "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
||||||
systemctl disable hostapd
|
|
||||||
systemctl stop hostapd
|
|
||||||
#systemctl disable dnsmasq
|
#systemctl disable dnsmasq
|
||||||
#systemctl stop dnsmasq
|
#systemctl stop dnsmasq
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
@ -31,12 +30,12 @@ systemctl restart dhcpcd
|
||||||
# ip link set dev wlan0 promisc on
|
# ip link set dev wlan0 promisc on
|
||||||
#fi
|
#fi
|
||||||
{% else %}
|
{% else %}
|
||||||
#ubuntu
|
#ubuntu (or Mint, or pure Debian?)
|
||||||
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
||||||
sed -i -e "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
sed -i "s|managed=0|managed=1|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
||||||
fi
|
fi
|
||||||
echo -e "\nPlease reboot to enable upstream WiFi access.\n"
|
echo -e "\nIf you're enabling upstream WiFi, please reboot now.\n"
|
||||||
exit 0
|
#exit 0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
#is_raspbian
|
#is_raspbian
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -9,18 +9,17 @@ echo -e "If you add Wi-Fi hardware, run 'cd /opt/iiab/iiab' then 'sudo ./iiab-ne
|
||||||
echo -e "For details, see: https://github.com/iiab/iiab/pull/3179\n"
|
echo -e "For details, see: https://github.com/iiab/iiab/pull/3179\n"
|
||||||
exit 1
|
exit 1
|
||||||
{% else %}
|
{% else %}
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
sed -i "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
{% if wifi_up_down %}
|
{% if wifi_up_down %}
|
||||||
systemctl enable iiab-clone-wifi.service
|
systemctl enable iiab-clone-wifi.service
|
||||||
systemctl enable hostapd
|
systemctl enable hostapd
|
||||||
systemctl enable iiab-wifi-test.service
|
systemctl enable iiab-wifi-test.service
|
||||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
#exit 0
|
||||||
exit 0
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% 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
|
||||||
sed -i -e "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
sed -i "s/^#denyinterfaces/denyinterfaces/" /etc/dhcpcd.conf
|
||||||
# shut down wlan0 in case connected to network
|
# shut down wlan0 in case connected to network
|
||||||
ip link set wlan0 down
|
ip link set wlan0 down
|
||||||
systemctl enable hostapd
|
systemctl enable hostapd
|
||||||
|
@ -38,13 +37,12 @@ systemctl start dnsmasq
|
||||||
# ip link set dev wlan0 promisc off
|
# ip link set dev wlan0 promisc off
|
||||||
#fi
|
#fi
|
||||||
{% else %}
|
{% else %}
|
||||||
#ubuntu
|
#ubuntu (or Mint, or pure Debian?)
|
||||||
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
if [ -f /etc/NetworkManager/conf.d/wifi-manage.conf ]; then
|
||||||
sed -i -e "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
sed -i "s|managed=1|managed=0|" /etc/NetworkManager/conf.d/wifi-manage.conf
|
||||||
fi
|
fi
|
||||||
systemctl enable hostapd
|
systemctl enable hostapd
|
||||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
#exit 0
|
||||||
exit 0
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
#is_raspbian
|
#is_raspbian
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -53,3 +51,5 @@ exit 0
|
||||||
#can_be_ap
|
#can_be_ap
|
||||||
{% endif %}
|
{% endif %}
|
||||||
#network_enabled
|
#network_enabled
|
||||||
|
|
||||||
|
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||||
|
|
|
@ -1,4 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 2023-04-24 PR #3542 / PR #3549 context:
|
||||||
|
# "systemd-network" "RasPiOS" have files with the client wifi info within them,
|
||||||
|
# those can be parsed for the ssid without needing the related service running
|
||||||
|
# first.
|
||||||
|
# "Netplan systemd" "NetworkManager" need to be running to be able to parse for
|
||||||
|
# the ssid, from the generated config file for "Netplan systemd" and from the
|
||||||
|
# running environment for "NetworkManager".
|
||||||
|
# "iiab-wifi-test.service" acts as a bit of a traffic cop keeping the ordering
|
||||||
|
# of the services more deterministic when active and tries to catch a channel
|
||||||
|
# mismatch between client wifi's current setting and what is contained within
|
||||||
|
# hostapd.conf early in the boot process.
|
||||||
|
|
||||||
IFACE={{ discovered_wireless_iface }}
|
IFACE={{ discovered_wireless_iface }}
|
||||||
NETPLAN=0
|
NETPLAN=0
|
||||||
SSID=""
|
SSID=""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue