pve-no-subscription/no-subscription-warning.sh

22 lines
570 B
Bash
Raw Permalink Normal View History

2020-05-10 10:48:22 +02:00
#!/bin/bash
2016-04-14 10:46:40 +02:00
2020-05-10 10:48:22 +02:00
PATCHED=0
2020-05-10 10:48:22 +02:00
if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ) -gt 0 ]
then
PATCHED=1
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/proxmoxlib.patch
fi
2020-05-10 10:48:22 +02:00
if [ $( grep -c "<h1>No valid subscription</h1>" /usr/share/pve-manager/js/pvemanagerlib.js ) -gt 0 ]
then
PATCHED=1
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/pvemanagerlib.patch
fi
2020-05-10 10:48:22 +02:00
if [ "$PATCHED" == "1" ]
then
systemctl restart pvedaemon
systemctl restart pveproxy
fi