Skip to content

Commit 7cb980b

Browse files
committed
Remove css js webfonts from public_html if they were installed by Hestia
- folder content must match checksum
1 parent 248078a commit 7cb980b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

install/upgrade/0.10.0-190430.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,24 @@ cp -rf $HESTIA/install/deb/templates/web/skel/document_errors/* /var/www/documen
144144
chmod 644 /var/www/html/*
145145
chmod 644 /var/www/document_errors/*
146146

147+
for user in `ls /usr/local/hestia/data/users/`; do
148+
USER_DATA=$HESTIA/data/users/$user
149+
for domain in $($BIN/v-list-web-domains $user plain |cut -f 1); do
150+
WEBFOLDER="/home/$user/web/$domain/public_html"
151+
folderchecksum=$(find "$WEBFOLDER/css" "$WEBFOLDER/js" "$WEBFOLDER/webfonts" -type f -print0 2>/dev/null |sort -z |xargs -r0 cat |md5sum |cut -d" " -f1)
152+
if [ "$folderchecksum" = "926feacc51384fe13598631f9d1360c3" ]; then
153+
rm -rf "$WEBFOLDER/css" "$WEBFOLDER/js" "$WEBFOLDER/webfonts"
154+
fi
155+
unset folderchecksum
156+
unset WEBFOLDER
157+
done
158+
done
159+
folderchecksum=$(find /var/www/html/css /var/www/html/js /var/www/html/webfonts -type f -print0 2>/dev/null |sort -z |xargs -r0 cat |md5sum |cut -d" " -f1)
160+
if [ "$folderchecksum" = "d148d5173e5e4162d7af0a60585392cb" ]; then
161+
rm -rf /var/www/html/css /var/www/html/js /var/www/html/webfonts
162+
fi
163+
unset folderchecksum
164+
147165
# Correct other permissions
148166
if [ -d "/var/cache/bind" ]; then
149167
chown bind:bind /var/cache/bind

0 commit comments

Comments
 (0)