@@ -15,8 +15,9 @@ source $HESTIA/conf/hestia.conf
1515source /usr/local/hestia/func/main.sh
1616
1717# Initialize backup directory
18- mkdir -p $HESTIA_BACKUP /templates /
18+ mkdir -p $HESTIA_BACKUP /conf /
1919mkdir -p $HESTIA_BACKUP /packages/
20+ mkdir -p $HESTIA_BACKUP /templates/
2021
2122# Detect OS
2223case $( head -n1 /etc/issue | cut -f 1 -d ' ' ) in
@@ -50,53 +51,55 @@ echo ""
5051echo " This process may take a few minutes, please wait..."
5152echo " "
5253echo " "
54+ echo " Existing files will be backed up to the following location:"
55+ echo " $HESTIA_BACKUP /"
56+ echo " "
57+ echo " "
5358
54- # Update Apache and NGINX configuration to support new file structure
59+ # Update Apache and Nginx configuration to support new file structure
5560if [ -f /etc/apache2/apache.conf ]; then
5661 echo " (*) Updating Apache configuration..."
62+ mv /etc/apache2/apache.conf $HESTIA_BACKUP /conf/
5763 cp -f $HESTIA /install/deb/apache2/apache.conf /etc/apache2/apache.conf
5864fi
5965if [ -f /etc/nginx/nginx.conf ]; then
60- echo " (*) Updating nginx configuration..."
66+ echo " (*) Updating Nginx configuration..."
67+ mv /etc/nginx/nginx.conf $HESTIA_BACKUP /conf/
6168 cp -f $HESTIA /install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
6269fi
6370
64- # Generating dhparam.
71+ # Generating dhparam
6572if [ ! -e /etc/ssl/dhparam.pem ]; then
6673 echo " (*) Enabling HTTPS Strict Transport Security (HSTS) support..."
67-
68- # Backup existing conf
69- mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
70-
71- # Copy new nginx config
74+ mv /etc/nginx/nginx.conf $HESTIA_BACKUP /conf/
7275 cp -f $hestiacp /nginx/nginx.conf /etc/nginx/
7376
7477 # Copy dhparam
7578 cp -f $hestiacp /ssl/dhparam.pem /etc/ssl/
7679
77- # Update dns servers in nginx.conf
80+ # Update DNS servers in nginx.conf
7881 dns_resolver=$( cat /etc/resolv.conf | grep -i ' ^nameserver' | cut -d ' ' -f2 | tr ' \r\n' ' ' | xargs)
7982 sed -i " s/1.0.0.1 1.1.1.1/$dns_resolver /g" /etc/nginx/nginx.conf
8083
81- # Restart nginx service
84+ # Restart Nginx service
8285 service nginx restart > /dev/null 2>&1
8386fi
8487
85- # Install and configure z-push
88+ # Install and configure Z-Push
8689if [ ! -z " $MAIL_SYSTEM " ]; then
8790 echo " (*) Installing Z-Push..."
8891 # Remove previous Z-Push configuration
8992 rm -rf /etc/z-push/*
9093
91- # Disable apt package lock to install z-push
94+ # Disable apt package lock to install Z-Push
9295 mv /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock-frontend.bak
9396 mv /var/lib/dpkg/lock /var/lib/dpkg/lock.bak
9497 mv /var/cache/apt/archives/lock /var/cache/apt/archives/lock.bak
9598 mv /var/lib/dpkg/updates/ /var/lib/dpkg/updates.bak/
9699 mkdir -p /var/lib/dpkg/updates/
97100
98101 apt=" /etc/apt/sources.list.d"
99- # Remove old z-push apt data
102+ # Remove old Z-Push apt data
100103 rm -f $apt /z-push.list
101104
102105 if [ " $os " = ' ubuntu' ]; then
142145
143146# Update default page templates
144147echo " (*) Replacing default templates and packages..."
145- echo " Existing files have been backed up to the following location:"
146- echo " $HESTIA_BACKUP /"
147148
148149# Back up default package and install latest version
149150if [ -d $HESTIA /data/packages/ ]; then
152153
153154# Back up old template files and install the latest versions
154155if [ -d $HESTIA /data/templates/ ]; then
155- cp -rf $HESTIA /data/templates $HESTIA_BACKUP /
156+ cp -rf $HESTIA /data/templates $HESTIA_BACKUP /templates/
156157 $HESTIA /bin/v-update-web-templates
157158 $HESTIA /bin/v-update-dns-templates
158159 $HESTIA /bin/v-update-mail-templates
165166
166167# Back up and remove default index.html if it exists
167168if [ -f /var/www/html/index.html ]; then
168- cp -rf /var/www/html/index.html $HESTIA_BACKUP /templates/
169- rm -rf /var/www/html/index.html
169+ mv /var/www/html/index.html $HESTIA_BACKUP /templates/
170170fi
171171
172172# Configure default success page and set permissions on CSS, JavaScript, and Font dependencies for unassigned hosts
@@ -203,9 +203,9 @@ chmod 751 $HESTIA/data/templates/web/unassigned/css
203203chmod 751 $HESTIA /data/templates/web/unassigned/js
204204chmod 751 $HESTIA /data/templates/web/unassigned/webfonts
205205
206- # Add unassigned hosts configuration to nginx and apache2
206+ # Add unassigned hosts configuration to Nginx and Apache
207207if [ " $WEB_SYSTEM " = " apache2" ]; then
208- echo " (*) Adding unassigned hosts configuration to apache2 ..."
208+ echo " (*) Adding unassigned hosts configuration to Apache ..."
209209 if [ -f /usr/local/hestia/data/ips/* ]; then
210210 for ip in /usr/local/hestia/data/ips/* ; do
211211 ipaddr=${ip##*/ }
@@ -216,7 +216,7 @@ if [ "$WEB_SYSTEM" = "apache2" ]; then
216216 fi
217217fi
218218if [ " $PROXY_SYSTEM " = " nginx" ]; then
219- echo " (*) Adding unassigned hosts configuration to nginx ..."
219+ echo " (*) Adding unassigned hosts configuration to Nginx ..."
220220 if [ -f /usr/local/hestia/data/ips/* ]; then
221221 for ip in /usr/local/hestia/data/ips/* ; do
222222 ipaddr=${ip##*/ }
@@ -227,7 +227,7 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
227227 fi
228228fi
229229
230- # Fix empty pool error message for multiphp
230+ # Fix empty pool error message for MultiPHP
231231php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
232232if [ " $php_versions " -gt 1 ]; then
233233 for v in $( ls /etc/php/) ; do
@@ -237,7 +237,7 @@ if [ "$php_versions" -gt 1 ]; then
237237 done
238238fi
239239
240- # Set Purge to false in roundcube config - https://goo.gl/3Nja3u
240+ # Set Purge to false in Roundcube configuration - https://goo.gl/3Nja3u
241241echo " (*) Updating Roundcube configuration..."
242242if [ -f /etc/roundcube/config.inc.php ]; then
243243 sed -i " s/\['flag_for_deletion'] = 'Purge';/\['flag_for_deletion'] = false;/gI" /etc/roundcube/config.inc.php
251251
252252# Remove old OS-specific installation files if they exist to free up space
253253if [ -d $HESTIA /install/ubuntu ]; then
254- echo " (*) Removing old installation data files for Ubuntu..."
254+ echo " (*) Removing old HestiaCP installation files for Ubuntu..."
255255 rm -rf $HESTIA /install/ubuntu
256256fi
257257if [ -d $HESTIA /install/debian ]; then
258- echo " (*) Removing old installation data files for Debian..."
258+ echo " (*) Removing old HestiaCP installation files for Debian..."
259259 rm -rf $HESTIA /install/debian
260260fi
261261
262- # Fix dovecot configuration
263- echo " (*) Updating dovecot IMAP/POP server configuration..."
262+ # Fix Dovecot configuration
263+ echo " (*) Updating Dovecot IMAP/POP server configuration..."
264264if [ -f /etc/dovecot/conf.d/15-mailboxes.conf ]; then
265- # Remove mailboxes configuration if it exists
266- rm -f /etc/dovecot/conf.d/15-mailboxes.conf
265+ mv /etc/dovecot/conf.d/15-mailboxes.conf $HESTIA_BACKUP /conf/
267266fi
268267if [ -f /etc/dovecot/dovecot.conf ]; then
269- # Update dovecot configuration and restart dovecot service
268+ # Update Dovecot configuration and restart Dovecot service
269+ mv /etc/dovecot/dovecot.conf $HESTIA_BACKUP /conf/
270270 cp -f $HESTIA /install/deb/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
271271 systemctl restart dovecot
272272 sleep 0.5
273273fi
274274
275- # Fix exim configuration
275+ # Fix Exim configuration
276276if [ -f /etc/exim4/exim4.conf.template ]; then
277- echo " (*) Updating exim SMTP server configuration..."
277+ echo " (*) Updating Exim SMTP server configuration..."
278+ mv /etc/exim4/exim4.conf.template $HESTIA_BACKUP /conf/
278279 cp -f $HESTIA /install/deb/exim/exim4.conf.template /etc/exim4/exim4.conf.template
279280 # Reconfigure spam filter and virus scanning
280281 if [ ! -z " $ANTISPAM_SYSTEM " ]; then
@@ -285,7 +286,7 @@ if [ -f /etc/exim4/exim4.conf.template ]; then
285286 fi
286287fi
287288
288- # Add IMAP system variable to configuration if dovecot is installed
289+ # Add IMAP system variable to configuration if Dovecot is installed
289290if [ -z " $IMAP_SYSTEM " ]; then
290291 if [ -f /usr/bin/dovecot ]; then
291292 echo " (*) Adding missing IMAP_SYSTEM variable to hestia.conf..."
295296
296297# Remove global webmail configuration files in favor of per-domain vhosts
297298if [ -f /etc/apache2/conf.d/roundcube.conf ]; then
298- echo " (*) Removing global webmail configuration files for Apache2 ..."
299- rm -f /etc/apache2/conf.d/roundcube.conf
299+ echo " (*) Removing global webmail configuration files for Apache ..."
300+ mv /etc/apache2/conf.d/roundcube.conf $HESTIA_BACKUP /conf/
300301fi
301302if [ -f /etc/nginx/conf.d/webmail.inc ]; then
302- echo " (*) Removing global webmail configuration files for nginx ..."
303- rm -f /etc/nginx/conf.d/webmail.inc
303+ echo " (*) Removing global webmail configuration files for Nginx ..."
304+ mv /etc/nginx/conf.d/webmail.inc $HESTIA_BACKUP /conf/
304305fi
305306if [ -f /etc/nginx/conf.d/webmail.conf ]; then
306- echo " (*) Removing global webmail configuration files for nginx ..."
307- rm -f /etc/nginx/conf.d/webmail.conf
307+ echo " (*) Removing global webmail configuration files for Nginx ..."
308+ mv /etc/nginx/conf.d/webmail.conf $HESTIA_BACKUP /conf/
308309fi
309310
310- # Remove Webalizer and replace it with awstats as default
311- echo " (*) Setting awstats as default web statistics backend..."
311+ # Remove Webalizer and set AWStats as default
312+ echo " (*) Removing Webalizer and setting AWStats as default web statistics backend..."
312313apt purge webalizer -y > /dev/null 2>&1
313314sed -i " s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA /conf/hestia.conf
314315
@@ -326,7 +327,7 @@ for user in `ls /usr/local/hestia/data/users/`; do
326327 sleep 1
327328done
328329
329- # Restart services server
330+ # Restart server services
330331echo " (*) Restarting services..."
331332sleep 5
332333$BIN /v-restart-mail $restart
0 commit comments