fix yate-config not pulling

This commit is contained in:
echtnurich 2024-09-08 21:08:17 +02:00
parent fb458e244b
commit e24b5b6fb1
Signed by: echtnurich
SSH key fingerprint: SHA256:1eIkxME0VPeXC2WMl9Haus+q0SLFymSAWU7f6Z+A8Aw

View file

@ -18,8 +18,7 @@
enable = true; enable = true;
description = "Yate telehony engine"; description = "Yate telehony engine";
unitConfig = { unitConfig = {
Type = "simple"; After= "network-online.target";
After= "network.target";
}; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.yate}/bin/yate -c /etc/yate -e /etc/yate/share"; ExecStart = "${pkgs.yate}/bin/yate -c /etc/yate -e /etc/yate/share";
@ -32,19 +31,16 @@
# ... # ...
}; };
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
requiredBy = [ "network.target" ]; requires = [ "network-online.target" ];
preStart = "echo \"\n\" >> /run/secrets/git_clone_key preStart = "echo \"\n\" >> /run/secrets/git_clone_key
sleep 1 sleep 5
SSH_SUCCESS=1 SSH_SUCCESS=1
${pkgs.openssh}/bin/ssh -q -i /run/secrets/git_clone_key forgejo@git.hamburg.ccc.de || SSH_SUCCESS=0 ${pkgs.openssh}/bin/ssh -q -i /run/secrets/git_clone_key forgejo@git.hamburg.ccc.de 2> /var/lib/yate/SSH_CHECK_LOG || SSH_SUCCESS=0
if [ $SSH_SUCCESS = 1 ]; then if [ $SSH_SUCCESS = 1 ]; then
rm -rf /var/lib/yate/* rm -rf /var/lib/yate/*
rm -rf /var/lib/yate/.* rm -rf /var/lib/yate/.*
${pkgs.git}/bin/git init /var/lib/yate env GIT_SSH_COMMAND=\"${pkgs.openssh}/bin/ssh -i /run/secrets/git_clone_key\" ${pkgs.git}/bin/git clone forgejo@git.hamburg.ccc.de:CCCHH/yate-config.git /var/lib/yate
${pkgs.git}/bin/git -C /var/lib/yate config --add safe.directory \"/var/lib/yate\" ${pkgs.git}/bin/git -C /var/lib/yate config --add safe.directory \"/var/lib/yate\"
${pkgs.git}/bin/git -C /var/lib/yate remote add origin forgejo@git.hamburg.ccc.de:CCCHH/yate-config.git
env GIT_SSH_COMMAND=\"${pkgs.openssh}/bin/ssh -i /run/secrets/git_clone_key\" ${pkgs.git}/bin/git -C /var/lib/yate fetch --all
${pkgs.git}/bin/git -C /var/lib/yate checkout --track -f origin/master
fi"; fi";
# ... # ...