From 919c5094148d7d6f294316efaddf9f7a0d9733e7 Mon Sep 17 00:00:00 2001 From: Arnaud <80671351+Buco7854@users.noreply.github.com> Date: Thu, 7 Aug 2025 23:39:03 +0200 Subject: [PATCH] feat: remove nag for mobile version of pve This commit removes the subscription nag for mobile version of pve. Basically this script adds new javascript inside the head section of the html (could not make it work in body probably related to the template). Then it waits for page to load and when it loaded, everytime the body is changed, it tries to get the nag and click on close button so that it disappear. Once it found the nag it stops watching for new change in the body. --- tools/pve/post-pve-install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/pve/post-pve-install.sh b/tools/pve/post-pve-install.sh index b8ab2da1..1657b6ee 100644 --- a/tools/pve/post-pve-install.sh +++ b/tools/pve/post-pve-install.sh @@ -515,7 +515,11 @@ post_routines_common() { yes) whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Support Subscriptions" "Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software." 10 58 msg_info "Disabling subscription nag" - echo "DPkg::Post-Invoke { \"if [ -s /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ] && ! grep -q -F 'NoMoreNagging' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; then echo 'Removing subscription nag from UI...'; sed -i '/data\.status/{s/\\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; fi\" };" >/etc/apt/apt.conf.d/no-nag-script + encoded_script=$(base64 -w0 <<'EOF' +[ -s /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ] && ! grep -q -F 'NoMoreNagging' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && echo 'Removing subscription nag from UI...' && sed -i '/data\.status/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; [ -f /usr/share/pve-yew-mobile-gui/index.html.tpl ] && sed -i '/' /usr/share/pve-yew-mobile-gui/index.html.tpl +EOF +) + echo "DPkg::Post-Invoke { \"echo $encoded_script | base64 -d | bash\"; };" > /etc/apt/apt.conf.d/no-nag-script msg_ok "Disabled subscription nag (Delete browser cache)" ;; no)