rootfs/usr/local/bin/git-sync.sh hinzugefügt
This commit is contained in:
24
rootfs/usr/local/bin/git-sync.sh
Normal file
24
rootfs/usr/local/bin/git-sync.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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 stash push -m "auto-sync"
|
||||
git pull --rebase
|
||||
git stash pop
|
||||
|
||||
|
||||
# Dateien verteilen (rootfs → /)
|
||||
sudo rsync -a rootfs/ "$TARGET"
|
||||
|
||||
chmod 600 /home/$USER/.ssh/*
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user