From 3f749036e4b173c28b4b918a3c7cd8ac6f8efd28 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 26 Feb 2020 02:21:27 -0600 Subject: [PATCH] update hostapd.service --- roles/network/templates/hostapd/hostapd.service.j2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/network/templates/hostapd/hostapd.service.j2 b/roles/network/templates/hostapd/hostapd.service.j2 index f7e19b96a..fbbdd37fc 100644 --- a/roles/network/templates/hostapd/hostapd.service.j2 +++ b/roles/network/templates/hostapd/hostapd.service.j2 @@ -1,8 +1,11 @@ [Unit] Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator -Before=network.target dhcpcd.service -After=network-pre.target Wants=network-pre.target +After=network-pre.target +{% if is_rpi %} +Before=dhcpcd.service +{% endif %} +Before=network.target [Service] Type=idle @@ -10,6 +13,8 @@ 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 -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