restart pppoe/l2tp in secrets changes

This commit is contained in:
Daniel Barlow
2024-08-30 20:49:27 +01:00
parent defbfce1fb
commit e745991b9d
2 changed files with 36 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
{
liminix
, lib
, svc
, output-template
, writeAshScript
, writeText
@@ -78,16 +79,19 @@ let
max redials = 2 # this gives 1 actual retry, as xl2tpd can't count
'';
control = "/run/${name}/control";
in
longrun {
inherit name;
run = ''
mkdir -p /run/${name}
chmod 0700 /run/${name}
touch ${control}
in_outputs ${name}
echo ${escapeShellArgs ppp-options'} | ${output-template}/bin/output-template '{{' '}}' > /run/${name}/ppp-options
exec ${xl2tpd}/bin/xl2tpd -D -p /run/${name}/${name}.pid -c ${conf} -C ${control}
'';
notification-fd = 10;
service = longrun {
inherit name;
run = ''
mkdir -p /run/${name}
chmod 0700 /run/${name}
touch ${control}
in_outputs ${name}
echo ${escapeShellArgs ppp-options'} | ${output-template}/bin/output-template '{{' '}}' > /run/${name}/ppp-options
exec ${xl2tpd}/bin/xl2tpd -D -p /run/${name}/${name}.pid -c ${conf} -C ${control}
'';
notification-fd = 10;
};
in svc.secrets.subscriber.build {
watch = [ username password ];
inherit service;
}