mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
ap0 - split cloning
This commit is contained in:
parent
25b503adc9
commit
8669a97d18
2 changed files with 22 additions and 15 deletions
20
roles/network/templates/hostapd/clone-wifi.service.j2
Normal file
20
roles/network/templates/hostapd/clone-wifi.service.j2
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
[Unit]
|
||||||
|
Description=IIAB ap0 clone wifi device
|
||||||
|
Wants=network-pre.target
|
||||||
|
After=network-pre.target
|
||||||
|
Before=dhcpcd.service
|
||||||
|
Before=wpa_supplicant.service
|
||||||
|
Before=wpa_supplicant@{{ discovered_wireless_iface }}.service
|
||||||
|
Before=network-manager.service
|
||||||
|
Before=netplan-wpa@{{ discovered_wireless_iface }}.service
|
||||||
|
Before=hostapd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
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
|
||||||
|
ExecStopPost=-/sbin/iw dev ap0 del
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -2,29 +2,16 @@
|
||||||
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
|
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
|
||||||
Wants=network-pre.target
|
Wants=network-pre.target
|
||||||
After=network-pre.target
|
After=network-pre.target
|
||||||
{% if is_raspbian %}
|
After=clone-wifi.service
|
||||||
Before=dhcpcd.service
|
Requires=clone-wifi.service
|
||||||
{% endif %}
|
|
||||||
Before=wpa_supplicant.service
|
|
||||||
Before=wpa_supplicant@{{ discovered_wireless_iface }}.service
|
|
||||||
{% if network_manager_active %}
|
|
||||||
Before=network-manager.service
|
|
||||||
{% endif %}
|
|
||||||
{% if is_ubuntu and netplan.stdout.find("yaml") != -1 %}
|
|
||||||
Before=netplan-wpa-{{ discovered_wireless_iface }}.service
|
|
||||||
{% endif %}
|
|
||||||
Before=network.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=2
|
RestartSec=2
|
||||||
PIDFile=/run/hostapd.pid
|
PIDFile=/run/hostapd.pid
|
||||||
ExecStartPre=-/sbin/iw phy phy0 interface add ap0 type __ap
|
|
||||||
ExecStartPre=-/sbin/ip link set ap0 address {{ ap0_mac_addr }}
|
|
||||||
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
|
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
|
||||||
ExecStartPost=-/sbin/ip link set ap0 up
|
ExecStartPost=-/sbin/ip link set ap0 up
|
||||||
ExecStopPost=-/sbin/iw dev ap0 del
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue