diff --git a/tools/pve/post-pve-install.sh b/tools/pve/post-pve-install.sh index c783d2fc..4764c044 100644 --- a/tools/pve/post-pve-install.sh +++ b/tools/pve/post-pve-install.sh @@ -370,7 +370,6 @@ EOF REPO_FILE="" REPO_ACTIVE=0 REPO_COMMENTED=0 - # Suche nach existierendem Block (aktiv oder auskommentiert) for file in /etc/apt/sources.list.d/*.sources; do if grep -q "Components:.*pve-no-subscription" "$file"; then REPO_FILE="$file" @@ -481,24 +480,24 @@ EOF fi # ---- PVETEST ---- - if component_exists_in_sources "pvetest"; then - msg_ok "'pvetest' repository already exists (skipped)" + if component_exists_in_sources "pve-test"; then + msg_ok "'pve-test' repository already exists (skipped)" else CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVETEST" \ - --menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n\nAdd (Disabled) 'pvetest' repository (deb822)?" 14 58 2 \ + --menu "The 'pve-test' repository can give advanced users access to new features and updates before they are officially released.\n\nAdd (Disabled) 'pvetest' repository (deb822)?" 14 58 2 \ "yes" " " \ "no" " " 3>&2 2>&1 1>&3) case $CHOICE in yes) - msg_info "Adding 'pvetest' repository (deb822, disabled)" - cat >/etc/apt/sources.list.d/pvetest.sources </etc/apt/sources.list.d/pve-test.sources <.*<\/script>/d' /usr/share/pve-yew-mobile-gui/index.html.tpl && sed -i '/<\/head>/i ' /usr/share/pve-yew-mobile-gui/index.html.tpl + # Create external script, this is needed because DPkg::Post-Invoke is fidly with quote interpretation + mkdir -p /usr/local/bin + cat >/usr/local/bin/pve-remove-nag.sh <<'EOF' +#!/bin/sh +WEB_JS=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js +if [ -s "$WEB_JS" ] && ! grep -q NoMoreNagging "$WEB_JS"; then + echo "Patching Web UI nag..." + sed -i -e "/data\.status/ s/!//" -e "/data\.status/ s/active/NoMoreNagging/" "$WEB_JS" +fi + +MOBILE_TPL=/usr/share/pve-yew-mobile-gui/index.html.tpl +MARKER="" +if [ -f "$MOBILE_TPL" ] && ! grep -q "$MARKER" "$MOBILE_TPL"; then + echo "Patching Mobile UI nag..." + printf "%s\n" \ + "$MARKER" \ + "" \ + "" >> "$MOBILE_TPL" +fi EOF -) - echo "DPkg::Post-Invoke { \"echo $encoded_script | base64 -d | bash\"; };" > /etc/apt/apt.conf.d/no-nag-script + chmod 755 /usr/local/bin/pve-remove-nag.sh + + cat >/etc/apt/apt.conf.d/no-nag-script <<'EOF' +DPkg::Post-Invoke { "/usr/local/bin/pve-remove-nag.sh"; }; +EOF + chmod 644 /etc/apt/apt.conf.d/no-nag-script + msg_ok "Disabled subscription nag (Delete browser cache)" ;; no)