hostapd set permissions on dir in /run/

This commit is contained in:
Daniel Barlow 2024-08-14 22:57:02 +01:00
parent fc03965915
commit 2f82e0dab8
1 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@ let
driver = "nl80211"; driver = "nl80211";
logger_syslog = "-1"; logger_syslog = "-1";
logger_syslog_level = 1; logger_syslog_level = 1;
ctrl_interface = "/run/hostapd"; ctrl_interface = "/run/${name}";
ctrl_interface_group = 0; ctrl_interface_group = 0;
}; };
attrs = defaults // params ; attrs = defaults // params ;
@ -43,7 +43,9 @@ in longrun {
inherit name; inherit name;
dependencies = [ interface ]; dependencies = [ interface ];
run = '' run = ''
${output-template}/bin/output-template '{{' '}}' < ${conf} > /run/${name}.conf mkdir -p /run/${name}
exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}.pid -S /run/${name}.conf 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
''; '';
} }