From 09d812bfd051fcffd9c2aa048234022ffa2c736f Mon Sep 17 00:00:00 2001 From: andre Date: Sat, 28 Feb 2026 18:38:20 +0100 Subject: [PATCH] rootfs/usr/local/bin/git-sync.sh aktualisiert --- rootfs/usr/local/bin/git-sync.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rootfs/usr/local/bin/git-sync.sh b/rootfs/usr/local/bin/git-sync.sh index 2516fe2..adac8ad 100644 --- a/rootfs/usr/local/bin/git-sync.sh +++ b/rootfs/usr/local/bin/git-sync.sh @@ -6,9 +6,14 @@ TARGET="/" # sicherstellen dass Repo existiert if [ ! -d "$REPO/.git" ]; then echo "Git-Repo nicht gefunden: $REPO" + mkdir -p /opt/ + cd /opt + echo "Klone Git-Repo nach /opt" + git clone http://vpnafgeissler.selfhost.co:8418/andre/git-sync.git exit 1 fi +echo "Aktualisiere Git-Repo" # Aktualisieren cd "$REPO" || exit 1 git stash push -m "auto-sync" @@ -16,10 +21,12 @@ git pull --rebase git stash pop +echo "Verteile Dateien" # Dateien verteilen (rootfs → /) #sudo rsync --no-o --no-g -a rootfs/ "$TARGET" rsync -rltpD rootfs/ "$TARGET" +echo "Setze Besitz und Berechtigungen" chmod +x /usr/local/bin/*.sh chown andre:andre /home/andre/ @@ -28,10 +35,14 @@ chown andre:andre /home/andre/.* -R chmod +x /home/andre/*.sh chmod 600 /home/andre/.ssh/* - +echo "Systemd Daemon Reload" systemctl daemon-reload + +echo "Services aktivieren und starten" systemctl enable git-sync.timer systemctl start git-sync.timer systemctl enable home-sync.timer systemctl start home-sync.timer + +echo "Fertig" exit 0 \ No newline at end of file