Files
linkvault/scripts/proxmox/update-linkvault.sh
Erik Thiele 517652708a Upgrade pip in the update script before installing requirements
Matches what install-linkvault.sh already does on first setup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-31 09:56:24 +02:00

49 lines
1.3 KiB
Bash
Executable File
Raw Permalink 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
git config --global --add safe.directory /opt/linkvault
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 --upgrade pip
.venv/bin/pip install -q -r requirements.txt
systemctl restart linkvault
"
echo "==> Fertig. Status:"
pct exec "$CTID" -- systemctl --no-pager status linkvault