mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +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 "For details, see: https://github.com/iiab/iiab/pull/3302\n"
|
||||
{% 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 stop hostapd
|
||||
{% if wifi_up_down %}
|
||||
|
@ -11,13 +11,12 @@ systemctl disable iiab-clone-wifi.service
|
|||
systemctl disable iiab-wifi-test.service
|
||||
systemctl stop iiab-clone-wifi.service
|
||||
echo " IIAB hotspot access point Disabled"
|
||||
exit 0
|
||||
#exit 0
|
||||
{% else %}
|
||||
echo " IIAB hotspot access point Disabled"
|
||||
{% if is_raspbian %}
|
||||
# hotspot-off before ap0_updown
|
||||
sed -i -e "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
||||
systemctl disable hostapd
|
||||
systemctl stop hostapd
|
||||
sed -i "s/^denyinterfaces/#denyinterfaces/" /etc/dhcpcd.conf
|
||||
#systemctl disable dnsmasq
|
||||
#systemctl stop dnsmasq
|
||||
systemctl daemon-reload
|
||||
|
@ -31,12 +30,12 @@ systemctl restart dhcpcd
|
|||
# ip link set dev wlan0 promisc on
|
||||
#fi
|
||||
{% else %}
|
||||
#ubuntu
|
||||
#ubuntu (or Mint, or pure Debian?)
|
||||
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
|
||||
echo -e "\nPlease reboot to enable upstream WiFi access.\n"
|
||||
exit 0
|
||||
echo -e "\nIf you're enabling upstream WiFi, please reboot now.\n"
|
||||
#exit 0
|
||||
{% endif %}
|
||||
#is_raspbian
|
||||
{% 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"
|
||||
exit 1
|
||||
{% 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 %}
|
||||
systemctl enable iiab-clone-wifi.service
|
||||
systemctl enable hostapd
|
||||
systemctl enable iiab-wifi-test.service
|
||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||
exit 0
|
||||
#exit 0
|
||||
{% else %}
|
||||
{% if is_raspbian %}
|
||||
# just do what we have always done in hotspot-on
|
||||
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
|
||||
ip link set wlan0 down
|
||||
systemctl enable hostapd
|
||||
|
@ -38,13 +37,12 @@ systemctl start dnsmasq
|
|||
# ip link set dev wlan0 promisc off
|
||||
#fi
|
||||
{% else %}
|
||||
#ubuntu
|
||||
#ubuntu (or Mint, or pure Debian?)
|
||||
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
|
||||
systemctl enable hostapd
|
||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||
exit 0
|
||||
#exit 0
|
||||
{% endif %}
|
||||
#is_raspbian
|
||||
{% endif %}
|
||||
|
@ -53,3 +51,5 @@ exit 0
|
|||
#can_be_ap
|
||||
{% endif %}
|
||||
#network_enabled
|
||||
|
||||
echo -e "\nPlease reboot to activate hostapd feature.\n"
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
#!/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 }}
|
||||
NETPLAN=0
|
||||
SSID=""
|
||||
|
|
Loading…
Reference in a new issue