Fix nag detection: PVE 9 effectively disabled the subscription popup
PVE 9.1 changed the JS condition to check for 'NoMoreNagging' status (case-sensitive compare after toLowerCase), which never matches. The subscription API returns status "notfound" which is truthy, so the nag dialog condition is always false. Detect PVE major version and skip nag check for PVE >= 9. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a7eb09e248
commit
9a87261823
|
|
@ -419,11 +419,17 @@ if grep -rq 'pve-no-subscription' /etc/apt/sources.list.d/ 2>/dev/null; then
|
|||
fi
|
||||
echo "$nosub"
|
||||
echo '---NAG_PATCHED---'
|
||||
# Check if the subscription nag popup has been patched
|
||||
# PVE 8: void({ replaces Ext.Msg.show
|
||||
# PVE 9: same pattern or similar
|
||||
if grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then
|
||||
echo 'yes'
|
||||
# Check if the subscription nag popup needs patching.
|
||||
# PVE 9.x changed the JS logic so the nag never triggers even without
|
||||
# patching (the condition checks for 'NoMoreNagging' which never matches).
|
||||
# PVE 8.x needs the void({ patch to suppress it.
|
||||
pve_major=$(pvesh get /version --output-format json 2>/dev/null \
|
||||
| python3 -c 'import sys,json; print(json.load(sys.stdin)["version"].split(".")[0])' 2>/dev/null \
|
||||
|| echo '8')
|
||||
if [ "$pve_major" -ge 9 ] 2>/dev/null; then
|
||||
echo 'yes' # PVE 9+ nag is effectively disabled
|
||||
elif grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then
|
||||
echo 'yes' # PVE 8 with JS patch applied
|
||||
elif ! grep -q "No valid subscription" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then
|
||||
echo 'yes' # nag text removed entirely
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue