From c4029e0ca955b7b6b64db7784573414576e52da7 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Wed, 26 Aug 2026 10:37:32 +0100 Subject: git-daemon is self-updating --- roles/git-daemon/files/update_git-daemon | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 roles/git-daemon/files/update_git-daemon (limited to 'roles/git-daemon/files/update_git-daemon') diff --git a/roles/git-daemon/files/update_git-daemon b/roles/git-daemon/files/update_git-daemon new file mode 100644 index 0000000..ecb7e47 --- /dev/null +++ b/roles/git-daemon/files/update_git-daemon @@ -0,0 +1,18 @@ +#!/bin/sh + +apk -U upgrade + +gitd_pid="$(pgrep gitd)" +if [ -z "$gitd_pid" ] +then + rc-service git-daemon restart + exit 0 +fi + +gitd_proc_start_time="$(stat -Lc %Y /proc/${gitd_pid})" +gitd_file_mtime="$(stat -Lc %Y $(which git))" + +if [ "$gitd_file_mtime" -gt "$gitd_proc_start_time" ] +then + rc-service git-daemon restart +fi -- cgit v1.2.3