mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
hostapd refinement
This commit is contained in:
parent
85a5f8fd98
commit
861652f141
1 changed files with 8 additions and 5 deletions
|
@ -1,13 +1,14 @@
|
||||||
- name: Disable the Access Point 'hostapd' service
|
|
||||||
systemd:
|
|
||||||
name: hostapd
|
|
||||||
enabled: no
|
|
||||||
|
|
||||||
- name: Disable hostapd when not using ap0 and wifi gateway present, or no WiFi hardware present or support not detected
|
- name: Disable hostapd when not using ap0 and wifi gateway present, or no WiFi hardware present or support not detected
|
||||||
set_fact:
|
set_fact:
|
||||||
hostapd_enabled: False
|
hostapd_enabled: False
|
||||||
when: (not wifi_up_down and discovered_wireless_iface == iiab_wan_iface) or discovered_wireless_iface == "none" or not can_be_ap
|
when: (not wifi_up_down and discovered_wireless_iface == iiab_wan_iface) or discovered_wireless_iface == "none" or not can_be_ap
|
||||||
|
|
||||||
|
- name: Disable the Access Point 'hostapd' service
|
||||||
|
systemd:
|
||||||
|
name: hostapd
|
||||||
|
enabled: no
|
||||||
|
when: not hostapd_enabled
|
||||||
|
|
||||||
- name: Detect current Wifi channel
|
- name: Detect current Wifi channel
|
||||||
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
||||||
register: current_client_channel
|
register: current_client_channel
|
||||||
|
@ -21,10 +22,12 @@
|
||||||
- name: Generate new random mac address for ap0
|
- name: Generate new random mac address for ap0
|
||||||
shell: tr -dc A-F0-9 < /dev/urandom | head -c 10 | sed -r 's/(..)/\1:/g;s/:$//;s/^/02:/'
|
shell: tr -dc A-F0-9 < /dev/urandom | head -c 10 | sed -r 's/(..)/\1:/g;s/:$//;s/^/02:/'
|
||||||
register: ap0_mac
|
register: ap0_mac
|
||||||
|
when: can_be_ap
|
||||||
|
|
||||||
- name: Setting ap0 mac address for use in hostapd service file
|
- name: Setting ap0 mac address for use in hostapd service file
|
||||||
set_fact:
|
set_fact:
|
||||||
ap0_mac_addr: "{{ ap0_mac.stdout }}"
|
ap0_mac_addr: "{{ ap0_mac.stdout }}"
|
||||||
|
when: can_be_ap
|
||||||
|
|
||||||
- name: "Use custom 'hostapd' systemd service unit file using ap0 -- install from template: /etc/systemd/system/hostapd.service, /etc/systemd/system/iiab-clone-wifi.service, /etc/systemd/system/iiab-wifi-test.service, /usr/sbin/iiab-test-wifi"
|
- name: "Use custom 'hostapd' systemd service unit file using ap0 -- install from template: /etc/systemd/system/hostapd.service, /etc/systemd/system/iiab-clone-wifi.service, /etc/systemd/system/iiab-wifi-test.service, /usr/sbin/iiab-test-wifi"
|
||||||
template:
|
template:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue