PVE-mods/debian/pve-mod.postinst
2026-06-07 12:55:03 +02:00

37 lines
1.2 KiB
Bash

#!/bin/bash
set -e
NODES_PM="/usr/share/perl5/PVE/API2/Nodes.pm"
case "$1" in
configure)
# Check for legacy bash-script install markers and warn the user.
if grep -qF '$res->{sensorsJSONOutput}' "$NODES_PM" 2>/dev/null || \
grep -qF '$res->{systemInfo}' "$NODES_PM" 2>/dev/null; then
echo ""
echo "WARNING: A legacy pve-mod bash-script installation was detected in Nodes.pm."
echo "The old installation should be removed first to avoid conflicts:"
echo " bash /path/to/pve-mod-gui-sensors.sh uninstall"
echo ""
echo "Skipping patch application. Run 'pve-mod-configure' after removing the old install."
echo ""
else
# Apply patches for any enabled modules (idempotent, safe on upgrades).
/usr/lib/pve-mod/apply-patches.sh 2>&1 || true
fi
if [ -z "$2" ]; then
echo ""
echo "pve-mod installed successfully."
echo "Run 'pve-mod-configure' to enable and configure modules."
echo ""
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
esac
#DEBHELPER#
exit 0