From 3d53b2213ceccea88a01daacd76b42d5c1fcbc09 Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Sun, 2 Nov 2025 00:00:13 +0100 Subject: [PATCH] auto up 00:00:12 up 0:08, 2 users, load average: 1.56, 0.92, 0.48 --- shell/up.sh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/shell/up.sh b/shell/up.sh index 9259c5a..396aaf6 100755 --- a/shell/up.sh +++ b/shell/up.sh @@ -12,19 +12,28 @@ REPOS=( # Commit message COMMIT_MSG="auto up $(uptime)" -for repo in "${REPOS[@]}"; do +process_repo() { + local repo="$1" + if [ -d "$repo/.git" ]; then - echo "Processing $repo... - - - " - cd "$repo" || continue - git fetch - git add . - git commit -m "$COMMIT_MSG" - git pull --rebase - git push + echo "Processing $repo..." + ( + cd "$repo" || exit + git fetch + git add . + git commit -m "$COMMIT_MSG" >/dev/null 2>&1 || true + git pull --rebase + git push + echo "Done: $repo" + ) else echo "Skipping $repo: not a git repository" fi +} + +for repo in "${REPOS[@]}"; do + process_repo "$repo" & done + +wait +echo "All repositories processed."