mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
27 lines
830 B
Django/Jinja
27 lines
830 B
Django/Jinja
[Unit]
|
|
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
|
|
Wants=network-pre.target
|
|
After=network-pre.target
|
|
{% if is_raspbian %}
|
|
Before=dhcpcd.service
|
|
{% endif %}
|
|
Before=wpa_supplicant.service
|
|
Before=wpa_supplicant@{{ discovered_wireless_iface }}.service
|
|
{% if is_ubuntu and netplan.stdout.find("yaml") != -1 %}
|
|
Before=netplan-wpa@{{ discovered_wireless_iface }}.service
|
|
{% endif %}
|
|
Before=network.target
|
|
|
|
[Service]
|
|
Type=forking
|
|
Restart=on-failure
|
|
RestartSec=2
|
|
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
|
|
ExecStartPost=-/sbin/ip link set ap0 up
|
|
ExecStopPost=-/sbin/iw dev ap0 del
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|