This repository has been archived on 2026-08-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
debian-configuration/.claude/worktrees/debian-restructure/proxmox/scripts/disable-subscription-nag.sh
T
beatzaplenty a6a419bad7
Secret Scan / Scan for secrets and sensitive config (push) Failing after 4s
updated structure
2026-07-24 06:22:31 +10:00

25 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Install the subscription-nag patch (lib/nag-patch.sh) as a persistent
# standalone script under /usr/local/sbin, plus an apt Post-Invoke hook that
# re-applies it after every dpkg run - a proxmox-widget-toolkit package
# upgrade overwrites the patched file, so without the hook the patch would
# silently revert on the next `apt upgrade`.
#
# Idempotent - safe to re-run. Run as root on the PVE host.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib/common.sh
source "${SCRIPT_DIR}/lib/common.sh"
require_root
INSTALLED="/usr/local/sbin/pve-disable-subscription-nag.sh"
write_if_changed "$INSTALLED" "$(cat "${SCRIPT_DIR}/lib/nag-patch.sh")"
chmod +x "$INSTALLED"
HOOK="/etc/apt/apt.conf.d/85pve-nosubnag"
write_if_changed "$HOOK" 'DPkg::Post-Invoke { "test -x /usr/local/sbin/pve-disable-subscription-nag.sh && /usr/local/sbin/pve-disable-subscription-nag.sh || true"; };'
"$INSTALLED"
echo "Subscription nag patch installed; will reapply automatically after updates."