hosts/carbon: Restructure ExecStartPre script for pppd-dtagdsl
This commit is contained in:
parent
d09e80e88e
commit
b860650ead
@ -26,10 +26,8 @@
|
|||||||
|
|
||||||
environment.etc."ppp/peers/dtagdsl".enable = false;
|
environment.etc."ppp/peers/dtagdsl".enable = false;
|
||||||
|
|
||||||
systemd.services."pppd-dtagdsl".serviceConfig = {
|
systemd.services."pppd-dtagdsl".serviceConfig = let
|
||||||
EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path;
|
preStart = ''
|
||||||
ExecStartPre = [
|
|
||||||
"+${utils.systemdUtils.lib.makeJobScript "pppd-dtagdsl-pre-start" ''
|
|
||||||
mkdir -p /etc/ppp/peers
|
mkdir -p /etc/ppp/peers
|
||||||
|
|
||||||
# Created files only readable by root
|
# Created files only readable by root
|
||||||
@ -44,7 +42,14 @@
|
|||||||
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/pap-secrets
|
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/pap-secrets
|
||||||
rm -f /etc/ppp/chap-secrets
|
rm -f /etc/ppp/chap-secrets
|
||||||
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets
|
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets
|
||||||
''}"
|
'';
|
||||||
|
|
||||||
|
preStartFile = utils.systemdUtils.lib.makeJobScript "pppd-dtagdsl-pre-start" preStart;
|
||||||
|
in {
|
||||||
|
EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path;
|
||||||
|
ExecStartPre = [
|
||||||
|
# "+" marks script to be executed without priviledge restrictions
|
||||||
|
"+${preStartFile}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user