From 0614cf1978034838a2176f32d8942b136fcedd36 Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Mon, 21 Jul 2025 23:14:24 +0200 Subject: [PATCH] Update no-sub-hack.sh Fix for Proxmox 8.4.5 and 9.0 beta compatibility --- no-sub-hack.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/no-sub-hack.sh b/no-sub-hack.sh index 5a4f743..27a23ef 100644 --- a/no-sub-hack.sh +++ b/no-sub-hack.sh @@ -1,16 +1,24 @@ #!/bin/bash # Proxmox no-subsscription hack +set -euo pipefail + filename=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js -cat ${filename} | grep "checked_command: function(orig_cmd) { orig_cmd(); }," > /dev/null -if [ $? -gt 0 ]; then - first_line=$(cat ${filename} | grep -n -m1 checked_command | cut -d ':' -f1) - last_line=$(( $(tail -n "+${first_line}" ${filename} | grep -xnm1 ' },' | cut -d':' -f1) + $first_line )) - sed -i ${first_line},${last_line}d ${filename} - insert_line=$(( ${first_line} - 1 )) - ex ${filename} <