Files
linkvault/scripts/proxmox/update-linkvault.sh
Erik Thiele 0d2e33f899 Add update script for Proxmox LXC containers
Adds scripts/proxmox/update-linkvault.sh to pull the latest git
changes, refresh dependencies, and restart the systemd service on an
existing container. Documents usage in the README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 20:33:14 +02:00

47 lines
1.2 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
#
# LinkVault Update-Script für einen bestehenden Proxmox-LXC-Container
#
# Muss als root auf dem Proxmox-VE-Host ausgeführt werden. Zieht den
# neuesten Stand aus Git, aktualisiert die Python-Abhängigkeiten und
# startet den systemd-Service neu.
#
# Verwendung (auf dem Proxmox-Host):
# CTID=113 bash update-linkvault.sh
#
# Bei privatem Repo zusätzlich das Gitea Access Token setzen:
# CTID=113 GIT_TOKEN=<token> bash update-linkvault.sh
#
set -euo pipefail
CTID="${CTID:-}"
GIT_TOKEN="${GIT_TOKEN:-}"
if ! command -v pct &>/dev/null; then
echo "Fehler: 'pct' nicht gefunden dieses Script muss auf einem Proxmox-VE-Host laufen." >&2
exit 1
fi
if [ -z "$CTID" ]; then
echo "Fehler: CTID muss gesetzt sein, z.B. 'CTID=113 bash update-linkvault.sh'." >&2
exit 1
fi
echo "==> Aktualisiere LinkVault in Container $CTID..."
pct exec "$CTID" -- bash -c "
set -euo pipefail
cd /opt/linkvault
if [ -n '${GIT_TOKEN}' ]; then
git -c http.extraHeader=\"Authorization: token ${GIT_TOKEN}\" pull --ff-only
else
git pull --ff-only
fi
.venv/bin/pip install -q -r requirements.txt
systemctl restart linkvault
"
echo "==> Fertig. Status:"
pct exec "$CTID" -- systemctl --no-pager status linkvault