2017-05-27 18:09:50 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
|
2019-08-08 18:04:48 +00:00
|
|
|
Wants=network-pre.target
|
2020-02-26 08:21:27 +00:00
|
|
|
After=network-pre.target
|
2020-03-10 05:38:58 +00:00
|
|
|
{% if is_raspbian %}
|
2020-02-26 08:21:27 +00:00
|
|
|
Before=dhcpcd.service
|
|
|
|
{% endif %}
|
2020-04-04 06:07:26 +00:00
|
|
|
Before=wpa_supplicant.service
|
|
|
|
Before=wpa_supplicant@{{ discovered_wireless_iface }}.service
|
2020-04-04 10:52:35 +00:00
|
|
|
{% if netplan.stdout.find("yaml") != -1 %}
|
|
|
|
Before=netplan-wpa@{{ discovered_wireless_iface }}
|
|
|
|
{% endif %}
|
2020-02-26 08:21:27 +00:00
|
|
|
Before=network.target
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
[Service]
|
2020-03-11 05:39:45 +00:00
|
|
|
Type=forking
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=2
|
2017-05-27 18:09:50 +00:00
|
|
|
PIDFile=/run/hostapd.pid
|
2018-12-31 06:51:29 +00:00
|
|
|
ExecStartPre=-/sbin/iw phy phy0 interface add ap0 type __ap
|
|
|
|
ExecStartPre=-/sbin/ip link set ap0 address {{ ap0_mac_addr }}
|
2020-03-11 05:39:45 +00:00
|
|
|
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
|
2020-02-26 08:21:27 +00:00
|
|
|
ExecStartPost=-/sbin/ip link set ap0 up
|
|
|
|
ExecStopPost=-/sbin/iw dev ap0 del
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|