introduce /etc/yate, clone/reset on service start

This commit is contained in:
echtnurich 2024-06-09 18:12:01 +02:00
parent 2037a1b647
commit b4de5dbb53
Signed by: echtnurich
SSH key fingerprint: SHA256:1eIkxME0VPeXC2WMl9Haus+q0SLFymSAWU7f6Z+A8Aw

View file

@ -9,13 +9,20 @@
After="network.target"; After="network.target";
}; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.yate}/bin/yate -c /yate -e /yate/share -Do"; ExecStart = "${pkgs.yate}/bin/yate -c /etc/yate -e /etc/yate/share -Do";
Type="simple"; Type="simple";
Restart="always"; Restart="always";
# ... # ...
}; };
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
requiredBy = [ "network.target" ]; requiredBy = [ "network.target" ];
preStart = "if mkdir -p /etc/yate
then
${pkgs.git}/bin/git -C /etc/yate clone forgejo@git.hamburg.ccc.de:echtnurich/yate-config.git
${pkgs.git}/bin/git -C /etc/yate pull
else
${pkgs.git}/bin/git -C /etc/yate checkout -f origin/main
fi";
# ... # ...
}; };
} }