mirror of
https://github.com/bashclub/no-sub-hack.git
synced 2024-11-07 20:01:58 +01:00
Create no-sub-hack.sh
This commit is contained in:
commit
21d53023fb
16
opt/bashclub/no-sub-hack.sh
Normal file
16
opt/bashclub/no-sub-hack.sh
Normal file
@ -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} <<eof
|
||||
${insert_line} insert
|
||||
checked_command: function(orig_cmd) { orig_cmd(); },
|
||||
.
|
||||
xit
|
||||
eof
|
||||
fi
|
Loading…
Reference in New Issue
Block a user