|
|
@@ -1,13 +1,27 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
-# Define vars
|
|
|
+# Define global variables
|
|
|
if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf"]; then
|
|
|
export HESTIA="/usr/local/hestia"
|
|
|
fi
|
|
|
+
|
|
|
+# Set backup folder
|
|
|
HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
|
|
|
+
|
|
|
+# Set installation source folder
|
|
|
hestiacp="$HESTIA/install/deb"
|
|
|
+
|
|
|
+# Set phpMyAdmin version for upgrade
|
|
|
pma_v='4.9.0.1'
|
|
|
|
|
|
+# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
|
|
|
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
|
|
|
+ sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
|
|
|
+fi
|
|
|
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
|
|
|
+ sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
|
|
|
+fi
|
|
|
+
|
|
|
# Add webmail alias variable to system configuration if non-existent
|
|
|
WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
|
|
|
if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
|
|
|
@@ -75,8 +89,7 @@ echo ""
|
|
|
|
|
|
# Set new version
|
|
|
sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
|
|
|
-# Set new branch variable
|
|
|
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
|
|
|
+echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
|
|
|
|
|
|
# Update Apache and Nginx configuration to support new file structure
|
|
|
if [ -f /etc/apache2/apache.conf ]; then
|
|
|
@@ -240,7 +253,7 @@ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
|
|
|
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
|
|
|
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
|
|
|
fi
|
|
|
- chmod 755 /etc/cron.daily/php-session-cleanup
|
|
|
+chmod 755 /etc/cron.daily/php-session-cleanup
|
|
|
|
|
|
# Fix empty pool error message for MultiPHP
|
|
|
php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
|
|
|
@@ -322,15 +335,14 @@ if [ ! -z "$WEBALIZER_CHECK" ]; then
|
|
|
sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
|
|
|
fi
|
|
|
|
|
|
-# Run sftp jail once
|
|
|
-$HESTIA/bin/v-add-sys-sftp-jail
|
|
|
+# Enable SFTP chroot jail capabilities
|
|
|
+$HESTIA/bin/v-add-sys-sftp-jail no
|
|
|
|
|
|
# Enable SFTP subsystem for SSH
|
|
|
sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
|
|
|
if [ ! -z "$sftp_subsys_enabled" ]; then
|
|
|
echo "(*) Updating SFTP subsystem configuration..."
|
|
|
sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
|
|
|
- systemctl restart ssh
|
|
|
fi
|
|
|
|
|
|
# Remove and migrate obsolete object keys
|
|
|
@@ -403,6 +415,26 @@ if [ "$DB_SYSTEM" = 'mysql' ]; then
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
+# Reset backend port
|
|
|
+if [ ! -z "$BACKEND_PORT" ]; then
|
|
|
+ /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
|
|
|
+fi
|
|
|
+
|
|
|
+# Move clamav to proper location - https://goo.gl/zNuM11
|
|
|
+if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
|
|
|
+ mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
|
|
|
+fi
|
|
|
+
|
|
|
+# Fix named rule for AppArmor - https://goo.gl/SPqHdq
|
|
|
+if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
|
|
|
+ echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
|
|
|
+fi
|
|
|
+
|
|
|
+# Remove obsolete ports.conf if exists.
|
|
|
+if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
|
|
|
+ rm -f /usr/local/hestia/data/firewall/ports.conf
|
|
|
+fi
|
|
|
+
|
|
|
# Add upgrade notification to admin user's panel
|
|
|
$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!'
|
|
|
|
|
|
@@ -423,8 +455,10 @@ if [ ! -z $DNS_SYSTEM ]; then
|
|
|
$BIN/v-restart-dns $restart
|
|
|
fi
|
|
|
|
|
|
-# restart Hestia services (nginx,php-fpm)
|
|
|
-systemctl restart hestia
|
|
|
+# Restart SSH daemon and Hestia Control Panel service
|
|
|
+$BIN/v-restart-service ssh $restart
|
|
|
+$BIN/v-restart-service hestia $restart
|
|
|
+
|
|
|
|
|
|
echo ""
|
|
|
echo " Upgrade complete! Please report any bugs or issues to"
|