Skip to content

Commit 11bd9f4

Browse files
author
Kristan Kenney
committed
Correct permissions on default page templates during upgrade
1 parent 5f8144b commit 11bd9f4

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

install/upgrade/0.9.8-28.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,73 @@ if [ ! -z "$BACKEND_PORT" ]; then
5858
/usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
5959
fi
6060

61+
62+
# Update default page templates
63+
echo '************************************************************************'
64+
echo "Replacing default templates and packages... "
65+
echo "Existing templates have been backed up to the following location: "
66+
echo "$HESTIA_BACKUP/templates/ "
67+
echo '************************************************************************'
68+
69+
# Back up default package and install latest version
70+
if [ -d $HESTIA/data/packages/ ]; then
71+
cp -f $HESTIA/data/packages/default.pkg $HESTIA_BACKUP/packages/
72+
fi
73+
74+
# Back up old template files and install the latest versions
75+
if [ -d $HESTIA/data/templates/ ]; then
76+
cp -rf $HESTIA/data/templates $HESTIA_BACKUP/
77+
$HESTIA/bin/v-update-web-templates
78+
$HESTIA/bin/v-update-dns-templates
79+
$HESTIA/bin/v-update-mail-templates
80+
$HESTIA/bin/v-update-sys-packages
81+
fi
82+
83+
# Remove old Office 365 template as there is a newer version with an updated name
84+
if [ -f $HESTIA/data/templates/dns/o365.tpl ]; then
85+
rm -f $HESTIA/data/templates/dns/o365.tpl
86+
fi
87+
88+
# Back up and remove default index.html if it exists
89+
if [ -f /var/www/html/index.html ]; then
90+
cp -rf /var/www/html/index.html $HESTIA_BACKUP/templates/
91+
rm -rf /var/www/html/index.html
92+
fi
93+
94+
# Configure default success page and set permissions on CSS, JavaScript, and Font dependencies for unassigned hosts
95+
if [ ! -d /var/www/html ]; then
96+
mkdir -p /var/www/html/
97+
fi
98+
99+
if [ ! -d /var/www/document_errors/ ]; then
100+
mkdir -p /var/www/document_errors/
101+
fi
102+
103+
cp -rf $HESTIA/install/deb/templates/web/unassigned/* /var/www/html/
104+
cp -rf $HESTIA/install/deb/templates/web/skel/document_errors/* /var/www/document_errors/
105+
chmod 644 /var/www/html/*
106+
chmod 751 /var/www/html/css
107+
chmod 751 /var/www/html/js
108+
chmod 751 /var/www/html/webfonts
109+
chmod 644 /var/www/document_errors/*
110+
chmod 751 /var/www/document_errors/css
111+
chmod 751 /var/www/document_errors/js
112+
chmod 751 /var/www/document_errors/webfonts
113+
114+
# Correct permissions on CSS, JavaScript, and Font dependencies for default templates
115+
chmod 751 $HESTIA/data/templates/web/skel/document_errors/css
116+
chmod 751 $HESTIA/data/templates/web/skel/document_errors/js
117+
chmod 751 $HESTIA/data/templates/web/skel/document_errors/webfonts
118+
chmod 751 $HESTIA/data/templates/web/skel/public_*html/css
119+
chmod 751 $HESTIA/data/templates/web/skel/public_*html/js
120+
chmod 751 $HESTIA/data/templates/web/skel/public_*html/webfonts
121+
chmod 751 $HESTIA/data/templates/web/suspend/css
122+
chmod 751 $HESTIA/data/templates/web/suspend/js
123+
chmod 751 $HESTIA/data/templates/web/suspend/webfonts
124+
chmod 751 $HESTIA/data/templates/web/unassigned/css
125+
chmod 751 $HESTIA/data/templates/web/unassigned/js
126+
chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
127+
61128
# Set Purge to false in roundcube config - https://goo.gl/3Nja3u
62129
if [ -f /etc/roundcube/config.inc.php ]; then
63130
sed -i "s/deletion'] = 'Purge'/deletion'] = false/g" /etc/roundcube/config.inc.php

0 commit comments

Comments
 (0)