Files
rtk-rover/git_push.sh
T

60 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -e
REPO_DIR="$HOME/rtk"
REMOTE_URL="https://gitea.haltenhopf47.ddns.net/DEINUSER/rtk-rover.git"
cd "$REPO_DIR"
echo "➡️ Git Repo prüfen..."
if [ ! -d .git ]; then
git init
git branch -M main
fi
echo "➡️ .gitignore sicherstellen..."
cat > .gitignore <<'EOGI'
# runtime / logs / databases
*.db
*.db-*
*.sqlite
logs/
*.log
*.tap
# Python
__pycache__/
*.pyc
.venv/
venv/
# backups
*.bak_*
EOGI
echo "➡️ systemd Files kopieren..."
mkdir -p systemd
sudo cp /etc/systemd/system/rtk-rover.service systemd/ 2>/dev/null || true
sudo cp /etc/systemd/system/rtk-base.service systemd/ 2>/dev/null || true
sudo chown -R "$USER":"$USER" systemd
echo "➡️ Dateien hinzufügen..."
git add -A
echo "➡️ Commit erstellen..."
if ! git diff --cached --quiet; then
git commit -m "auto: update RTK rover/base + config ($(date '+%F %T'))"
else
echo "ℹ️ Keine Änderungen zum Committen"
fi
echo "➡️ Remote prüfen..."
if ! git remote | grep -q origin; then
git remote add origin "$REMOTE_URL"
fi
echo "➡️ Push..."
git push -u origin main
echo "✅ Fertig."