From 159386cf0e5ab6e3732dcffa07d9e93c9c287059 Mon Sep 17 00:00:00 2001 From: andre Date: Sat, 29 Nov 2025 19:21:19 +0100 Subject: [PATCH] =?UTF-8?q?opt/git-sync/git-sync.sh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opt/git-sync/git-sync.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 opt/git-sync/git-sync.sh diff --git a/opt/git-sync/git-sync.sh b/opt/git-sync/git-sync.sh new file mode 100644 index 0000000..fa925c9 --- /dev/null +++ b/opt/git-sync/git-sync.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +REPO="/opt/git-sync/" +TARGET="/" + +# sicherstellen dass Repo existiert +if [ ! -d "$REPO/.git" ]; then + echo "Git-Repo nicht gefunden: $REPO" + exit 1 +fi + +# Aktualisieren +cd "$REPO" || exit 1 +git pull --rebase + +# Dateien verteilen (rootfs → /) +sudo rsync -a rootfs/ "$TARGET" + +exit 0