Skip to content

Commit e68c32b

Browse files
author
Kristan Kenney
committed
Add additional upgrade routines
* Ensure that custom port is not lost (hestiacp#374) * Ensure AppArmor rules are fixed * Ensure ClamAV daemon configuration is accessible * Ensure nginx & MariaDB repos have amd64 arch specification to suppress potential warnings * Minor syntax cleanup
1 parent b906202 commit e68c32b

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

install/upgrade/1.00.0-190618.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
88
hestiacp="$HESTIA/install/deb"
99
pma_v='4.9.0.1'
1010

11+
# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
12+
if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
13+
sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
14+
fi
15+
if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
16+
sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
17+
fi
18+
1119
# Add webmail alias variable to system configuration if non-existent
1220
WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
1321
if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
@@ -239,7 +247,7 @@ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
239247
echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
240248
echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
241249
fi
242-
chmod 755 /etc/cron.daily/php-session-cleanup
250+
chmod 755 /etc/cron.daily/php-session-cleanup
243251

244252
# Fix empty pool error message for MultiPHP
245253
php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
@@ -321,7 +329,7 @@ if [ ! -z "$WEBALIZER_CHECK" ]; then
321329
sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
322330
fi
323331

324-
# Run sftp jail once
332+
# Enable SFTP chroot jail capabilities
325333
$HESTIA/bin/v-add-sys-sftp-jail no
326334

327335
# Enable SFTP subsystem for SSH
@@ -401,6 +409,26 @@ if [ "$DB_SYSTEM" = 'mysql' ]; then
401409
fi
402410
fi
403411

412+
# Reset backend port
413+
if [ ! -z "$BACKEND_PORT" ]; then
414+
/usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
415+
fi
416+
417+
# Move clamav to proper location - https://goo.gl/zNuM11
418+
if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
419+
mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
420+
fi
421+
422+
# Fix named rule for AppArmor - https://goo.gl/SPqHdq
423+
if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
424+
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
425+
fi
426+
427+
# Remove obsolete ports.conf if exists.
428+
if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
429+
rm -f /usr/local/hestia/data/firewall/ports.conf
430+
fi
431+
404432
# Add upgrade notification to admin user's panel
405433
$BIN/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to v0.10.0.<br>Please report any bugs on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
406434

@@ -421,6 +449,7 @@ if [ ! -z $DNS_SYSTEM ]; then
421449
$BIN/v-restart-dns $restart
422450
fi
423451

452+
# Restart SSH daemon and Hestia Control Panel service
424453
$BIN/v-restart-service ssh $restart
425454
$BIN/v-restart-service hestia $restart
426455

0 commit comments

Comments
 (0)