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

48 lines
2.1 KiB
Bash
Raw Normal View History

2016-04-14 10:46:40 +02:00
#!/bin/sh
TYPE=unknown
[ -e /usr/share/pve-manager/ext4/pvemanagerlib.js ] && TYPE=ext4
[ -e /usr/share/pve-manager/ext6/pvemanagerlib.js ] && TYPE=ext6
[ -e /usr/share/pve-manager/js/pvemanagerlib.js ] && TYPE=js
case "$TYPE" in
ext4)
if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/ext4/pvemanagerlib.js ) -gt 0 ]
then
echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------"
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-ext4.patch
echo "------------------------------------------------------------------------------"
fi
;;
ext6)
2016-07-05 13:15:52 +02:00
if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/ext6/pvemanagerlib.js ) -gt 0 ]
then
echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------"
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-ext6.patch
echo "------------------------------------------------------------------------------"
fi
;;
js)
if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/pve-manager/js/pvemanagerlib.js ) -gt 0 ]
then
echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------"
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-js.patch
echo "------------------------------------------------------------------------------"
fi
2018-03-20 22:43:22 +01:00
if [ $( grep -c "if (data.status !== 'Active') {" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js ) -gt 0 ]
then
echo "---------------[ Patching with No-Subscription-Removal-Patch ]----------------"
cd / && patch --no-backup-if-mismatch -l -p0 < /usr/share/pve-no-subscription/no-subscription-warning-js2.patch
echo "------------------------------------------------------------------------------"
fi
;;
2018-03-20 22:43:22 +01:00
*)
echo "Unknown Type! Sourcefile not found!"
;;
esac