rootfs/usr/local/bin/git-sync.sh aktualisiert
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user