commit 2f82e0dab89c7874ef21875b95ce24a7f94245be parent fc0396591536cab970f7114caeb30c883e9d83d4 Author: Daniel Barlow <dan@telent.net> Date: Wed, 14 Aug 2024 22:57:02 +0100 hostapd set permissions on dir in /run/ Diffstat:
| M | modules/hostapd/service.nix | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/hostapd/service.nix b/modules/hostapd/service.nix @@ -21,7 +21,7 @@ let driver = "nl80211"; logger_syslog = "-1"; logger_syslog_level = 1; - ctrl_interface = "/run/hostapd"; + ctrl_interface = "/run/${name}"; ctrl_interface_group = 0; }; attrs = defaults // params ; @@ -43,7 +43,9 @@ in longrun { inherit name; dependencies = [ interface ]; run = '' - ${output-template}/bin/output-template '{{' '}}' < ${conf} > /run/${name}.conf - exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}.pid -S /run/${name}.conf + mkdir -p /run/${name} + chmod 0700 /run/${name} + ${output-template}/bin/output-template '{{' '}}' < ${conf} > /run/${name}/hostapd.conf + exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}/hostapd.pid -S /run/${name}/hostapd.conf ''; }