Browse Source

Merge pull request #76 from Weilbyte/weilbyte/issue73

Improve install process (fix #73)
pull/85/head 2021.05.06
Weilbyte 4 years ago
committed by GitHub
parent
commit
d3a2252dda
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      PVEDiscordDark.sh

14
PVEDiscordDark.sh

@ -65,9 +65,9 @@ function checkSupported {
} }
function isInstalled { function isInstalled {
if (grep -Fq "<link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE || if (grep -Fq "<link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE &&
grep -Fq "<script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE || grep -Fq "<script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE &&
[ -f "/usr/share/pve-manager/css/dd_style.css" ] ); then [ -f "/usr/share/pve-manager/css/dd_style.css" ] && [ -f "/usr/share/pve-manager/js/dd_patcher.js" ]); then
true true
else else
false false
@ -133,8 +133,12 @@ function install {
curl -s $BASE_URL/PVEDiscordDark/js/PVEDiscordDark.js > /usr/share/pve-manager/js/dd_patcher.js 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 if [ "$_silent" = false ]; then echo -e "${CHECKMARK} Applying changes to template file"; fi
echo "<link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" >> $TEMPLATE_FILE if !(grep -Fq "<link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE); then
echo "<script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" >> $TEMPLATE_FILE echo "<link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" >> $TEMPLATE_FILE
fi
if !(grep -Fq "<script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE); then
echo "<script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" >> $TEMPLATE_FILE
fi
local IMAGELIST=$(curl -f -s "$BASE_URL/meta/imagelist") local IMAGELIST=$(curl -f -s "$BASE_URL/meta/imagelist")
local IMAGELISTARR=($(echo "$IMAGELIST" | tr ',' '\n')) local IMAGELISTARR=($(echo "$IMAGELIST" | tr ',' '\n'))

Loading…
Cancel
Save