File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ function checkSupported {
65
65
}
66
66
67
67
function isInstalled {
68
- if (grep -Fq " <link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE ||
69
- grep -Fq " <script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE ||
70
- [ -f " /usr/share/pve-manager/css/dd_style.css" ] ); then
68
+ if (grep -Fq " <link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE &&
69
+ grep -Fq " <script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE &&
70
+ [ -f " /usr/share/pve-manager/css/dd_style.css" ] && [ -f " /usr/share/pve-manager/js/dd_patcher.js " ] ); then
71
71
true
72
72
else
73
73
false
@@ -133,8 +133,12 @@ function install {
133
133
curl -s $BASE_URL /PVEDiscordDark/js/PVEDiscordDark.js > /usr/share/pve-manager/js/dd_patcher.js
134
134
135
135
if [ " $_silent " = false ]; then echo -e " ${CHECKMARK} Applying changes to template file" ; fi
136
- echo " <link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" >> $TEMPLATE_FILE
137
- echo " <script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" >> $TEMPLATE_FILE
136
+ if ! (grep -Fq " <link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" $TEMPLATE_FILE ); then
137
+ echo " <link rel='stylesheet' type='text/css' href='/pve2/css/dd_style.css'>" >> $TEMPLATE_FILE
138
+ fi
139
+ if ! (grep -Fq " <script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" $TEMPLATE_FILE ); then
140
+ echo " <script type='text/javascript' src='/pve2/js/dd_patcher.js'></script>" >> $TEMPLATE_FILE
141
+ fi
138
142
139
143
local IMAGELIST=$( curl -f -s " $BASE_URL /meta/imagelist" )
140
144
local IMAGELISTARR=($( echo " $IMAGELIST " | tr ' ,' ' \n' ) )
You can’t perform that action at this time.
0 commit comments