Automates version bumps across all version source files: - Cargo.toml (PRIMARY - workspace.package.version) - debian/changelog (prepend new entry) - debian/control (update Version field) - scripts/build-package.sh (update VERSION variable) - frontend/package.json (update version field) - Stale references check after bump Usage: ./scripts/bump-version.sh <new_version> <old_version>
37 lines
903 B
Bash
37 lines
903 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
case "$1" in
|
|
purge)
|
|
# Remove service user (only if purge)
|
|
if id patch-manager &>/dev/null; then
|
|
userdel patch-manager 2>/dev/null || true
|
|
fi
|
|
|
|
# Remove runtime data
|
|
rm -rf /var/log/patch-manager
|
|
rm -rf /opt/patch-manager
|
|
rm -rf /var/backups/patch-manager
|
|
|
|
# Remove configuration and keys (purge only)
|
|
rm -rf /etc/patch-manager
|
|
|
|
# Remove backup cron
|
|
crontab -l 2>/dev/null | grep -vF "backup.sh" | crontab - 2>/dev/null || true
|
|
|
|
# Reload systemd
|
|
systemctl daemon-reload
|
|
;;
|
|
|
|
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
# On remove (not purge), keep config and keys
|
|
systemctl daemon-reload 2>/dev/null || true
|
|
;;
|
|
|
|
*)
|
|
echo "postrm called with unknown argument \`$1'" >&2
|
|
;;
|
|
esac
|
|
|
|
exit 0
|