diff --git a/PVEDiscordDark.sh b/PVEDiscordDark.sh
index 0d094e9..9f765cd 100644
--- a/PVEDiscordDark.sh
+++ b/PVEDiscordDark.sh
@@ -65,9 +65,9 @@ function checkSupported {
}
function isInstalled {
- if (grep -Fq "" $TEMPLATE_FILE ||
- grep -Fq "" $TEMPLATE_FILE ||
- [ -f "/usr/share/pve-manager/css/dd_style.css" ] ); then
+ if (grep -Fq "" $TEMPLATE_FILE &&
+ grep -Fq "" $TEMPLATE_FILE &&
+ [ -f "/usr/share/pve-manager/css/dd_style.css" ] && [ -f "/usr/share/pve-manager/js/dd_patcher.js" ]); then
true
else
false
@@ -133,8 +133,12 @@ function install {
curl -s $BASE_URL/PVEDiscordDark/js/PVEDiscordDark.js > /usr/share/pve-manager/js/dd_patcher.js
if [ "$_silent" = false ]; then echo -e "${CHECKMARK} Applying changes to template file"; fi
- echo "" >> $TEMPLATE_FILE
- echo "" >> $TEMPLATE_FILE
+ if !(grep -Fq "" $TEMPLATE_FILE); then
+ echo "" >> $TEMPLATE_FILE
+ fi
+ if !(grep -Fq "" $TEMPLATE_FILE); then
+ echo "" >> $TEMPLATE_FILE
+ fi
local IMAGELIST=$(curl -f -s "$BASE_URL/meta/imagelist")
local IMAGELISTARR=($(echo "$IMAGELIST" | tr ',' '\n'))