From 423d145db1ff4cb193ba42cc531d78f20a3861d8 Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Fri, 30 Apr 2021 22:54:35 +0200 Subject: [PATCH] Create no-sub-hack.sh --- no-sub-hack.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 no-sub-hack.sh diff --git a/no-sub-hack.sh b/no-sub-hack.sh new file mode 100644 index 0000000..5a4f743 --- /dev/null +++ b/no-sub-hack.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Proxmox no-subsscription hack +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} <