From 07b99ba91312ed31ebe4d96f892986768b428294 Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Sat, 1 Nov 2025 23:21:09 +0100 Subject: [PATCH] auto up 23:20:55 up 1:52, 2 users, load average: 1.80, 1.92, 1.80 --- shell/up.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 shell/up.sh diff --git a/shell/up.sh b/shell/up.sh new file mode 100755 index 0000000..0f0cacd --- /dev/null +++ b/shell/up.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# List of directories with git repositories +REPOS=( + "/home/jonas/nixos" + "/home/jonas/dotfiles" + "/home/jonas/.config/nvim" + "/home/jonas/projects/scripts" + "/home/jonas/projects/university" +) + +# Commit message +COMMIT_MSG="auto up $(uptime)" + +for repo in "${REPOS[@]}"; do + 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 + else + echo "Skipping $repo: not a git repository" + fi +done