Просмотр исходного кода

Improve upgrade script logic

Re-work of how upgrades are processed when skipping between versions.
Kristan Kenney 6 лет назад
Родитель
Сommit
a5cb4610e6

+ 0 - 76
install/upgrade/0.9.8-28.sh

@@ -1,76 +0,0 @@
-#!/bin/bash
-HESTIA="/usr/local/hestia"
-HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
-spinner="/-\|"
-
-function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
-
-# Set version(s)
-pma_v='4.8.5'
-
-# Upgrade phpMyAdmin
-if [ "$DB_SYSTEM" = 'mysql' ]; then
-    # Display upgrade information
-    echo "(*) Upgrading phpMyAdmin to v$pma_v..."
-
-    pma_release_file=$(ls /usr/share/phpmyadmin/RELEASE-DATE-* 2>/dev/null |tail -n 1)
-    if version_ge "${pma_release_file##*-}" "$pma_v"; then
-        echo "(*) phpMyAdmin $pma_v or newer is already installed: ${pma_release_file##*-}, skipping update..."
-    else
-        [ -d /usr/share/phpmyadmin ] || mkdir -p /usr/share/phpmyadmin
-
-        # Download latest phpMyAdmin release
-        wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
-
-        # Unpack files
-        tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
-
-        # Delete file to prevent error
-        rm -fr /usr/share/phpmyadmin/doc/html
-
-        # Overwrite old files
-        cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
-
-        # Set config and log directory
-        sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-        sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-
-        # Create temporary folder and change permissions
-        if [ ! -d /usr/share/phpmyadmin/tmp ]; then
-            mkdir /usr/share/phpmyadmin/tmp
-            chmod 777 /usr/share/phpmyadmin/tmp
-        fi
-
-        # Clean up
-        rm -fr phpMyAdmin-$pma_v-all-languages
-        rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
-    fi
-fi
-
-# 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
-
-# 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
-
-# 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

+ 0 - 33
install/upgrade/1.00.0-190621.sh

@@ -1,33 +0,0 @@
-#!/bin/bash
-
-# Define global variables
-if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf" ]; then
-    export HESTIA="/usr/local/hestia"
-    export BIN="/usr/local/hestia/bin"
-fi
-
-# Set backup folder
-HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
-
-# Set installation source folder
-hestiacp="$HESTIA/install/deb"
-
-# Load hestia.conf
-source /usr/local/hestia/conf/hestia.conf
-
-# Get hestia version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
-
-# Compare version for upgrade routine
-if [ "$version" != "1.00.0-190618" ] && [ "$version" != "0.10.0" ] then
-    source $HESTIA/install/upgrade/1.00.0-190618.sh
-fi
-
-# Place additional commands below.
-
-# Remove global options from nginx.conf to prevent conflicts with other web packages
-if [ -e /etc/nginx/nginx.conf ]; then
-    echo "(*) Updating NGINX global configuration..."
-    sed -i 's/add_header          X-Frame-Options SAMEORIGIN;/d' /etc/nginx/nginx.conf
-    sed -i 's/add_header          X-Content-Type-Options nosniff;/d' /etc/nginx/nginx.conf
-fi

+ 36 - 0
install/upgrade/messages.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+function welcome_message() {
+    echo
+    echo '     _   _           _   _        ____ ____        '
+    echo '    | | | | ___  ___| |_(_) __ _ / ___|  _ \       '
+    echo '    | |_| |/ _ \/ __| __| |/ _` | |   | |_) |      '
+    echo '    |  _  |  __/\__ \ |_| | (_| | |___|  __/       '
+    echo '    |_| |_|\___||___/\__|_|\__,_|\____|_|          '
+    echo ""
+    echo "       Hestia Control Panel Upgrade Script"
+    echo "             Version: $version                     "
+    echo "==================================================="
+    echo ""
+    echo "Existing files will be backed up to the following location:"
+    echo "$HESTIA_BACKUP/"
+    echo ""
+    echo "This process may take a few moments, please wait..."
+    echo ""
+}
+
+function upgrade_complete() {
+    echo ""
+    echo "    Upgrade complete! Please report any bugs or issues to"
+    echo "    https://github.com/hestiacp/hestiacp/issues"
+    echo ""
+    echo "    We hope that you enjoy this release of Hestia Control Panel,"
+    echo "    enjoy your day!"
+    echo ""
+    echo "    Sincerely,"
+    echo "    The Hestia Control Panel development team"
+    echo ""
+    echo "    www.hestiacp.com"
+    echo "    Made with love & pride by the open-source community around the world."
+    echo ""
+    echo ""
+}

+ 42 - 0
install/upgrade/phpmyadmin.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Define version check function
+function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+
+# Set phpMyAdmin version for upgrade
+pma_v='4.9.0.1'
+
+pma_release_file=$(ls /usr/share/phpmyadmin/RELEASE-DATE-* 2>/dev/null |tail -n 1)
+if version_ge "${pma_release_file##*-}" "$pma_v"; then
+    echo "(*) phpMyAdmin $pma_v or newer is already installed: ${pma_release_file##*-}, skipping update..."
+else
+    # Display upgrade information
+    echo "(*) Upgrade phpMyAdmin to v$pma_v..."
+    [ -d /usr/share/phpmyadmin ] || mkdir -p /usr/share/phpmyadmin
+
+    # Download latest phpMyAdmin release
+    wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
+ 
+    # Unpack files
+    tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
+
+    # Delete file to prevent error
+    rm -fr /usr/share/phpmyadmin/doc/html
+
+    # Overwrite old files
+    cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
+
+    # Set config and log directory
+    sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+    sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+
+    # Create temporary folder and change permissions
+    if [ ! -d /usr/share/phpmyadmin/tmp ]; then
+        mkdir /usr/share/phpmyadmin/tmp
+        chmod 777 /usr/share/phpmyadmin/tmp
+    fi
+
+    # Clean up source files
+    rm -fr phpMyAdmin-$pma_v-all-languages
+    rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
+fi

+ 21 - 0
install/upgrade/restart.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+echo "(*) Restarting services..."
+sleep 3
+if [ ! -z $MAIL_SYSTEM ]; then
+	$BIN/v-restart-mail $restart
+fi
+if [ ! -z $IMAP_SYSTEM ]; then
+	$BIN/v-restart-service $IMAP_SYSTEM $restart
+fi
+if [ ! -z $WEB_SYSTEM ]; then
+	$BIN/v-restart-web $restart
+	$BIN/v-restart-proxy $restart
+fi
+if [ ! -z $DNS_SYSTEM ]; then
+	$BIN/v-restart-dns $restart
+fi
+
+# Restart SSH daemon and Hestia Control Panel service
+$BIN/v-restart-service ssh $restart
+$BIN/v-restart-service hestia $restart

+ 21 - 0
install/upgrade/version.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [ $VERSION = "$version" ]; then
+    echo "(!) The latest version of Hestia Control Panel ($version) is already installed."
+    echo "    Verifying configuration..."
+    echo ""
+    source /usr/local/hestia/install/upgrade/versions/$version.sh
+    VERSION="$version"
+fi
+if [ $VERSION = "0.9.8-27" ]; then
+    source /usr/local/hestia/install/upgrade/versions/0.9.8-28.sh
+    VERSION="0.9.8-28"
+fi
+if [ $VERSION = "0.9.8-28" ]; then
+    source /usr/local/hestia/install/upgrade/versions/1.00.0-190618.sh
+    VERSION="1.00.0-190618"
+fi
+if [ $VERSION = "0.10.00" ] || [ $VERSION = "1.00.0-190618" ]; then
+    source /usr/local/hestia/install/upgrade/versions/$version.sh
+    VERSION="$version"
+fi

+ 34 - 0
install/upgrade/versions/0.9.8-28.sh

@@ -0,0 +1,34 @@
+#!/bin/bash
+HESTIA="/usr/local/hestia"
+HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+spinner="/-\|"
+
+function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+
+# 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
+
+# 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
+
+# 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

+ 4 - 127
install/upgrade/1.00.0-190618.sh → install/upgrade/versions/1.00.0-190618.sh

@@ -1,33 +1,12 @@
 #!/bin/bash
 
-# Define global variables
-if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf" ]; then
-    export HESTIA="/usr/local/hestia"
-    export BIN="/usr/local/hestia/bin"
-fi
-
-# Set backup folder
-HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
-
-# Set installation source folder
-hestiacp="$HESTIA/install/deb"
+# Define version check function
+function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
 
 # Load hestia.conf
 source /usr/local/hestia/conf/hestia.conf
 
-# Get hestia version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
-
-function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
-
-# Compare version for upgrade routine
-if [ "$version" != "0.9.8-28" ]; then
-    source $HESTIA/install/upgrade/0.9.8-28.sh
-fi
-
-
-# Set phpMyAdmin version for upgrade
-pma_v='4.9.0.1'
+####### Place additional commands below. #######
 
 # Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
 if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
@@ -87,43 +66,19 @@ if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
     echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
 fi
 
-# Clear the screen from apt output to prepare for upgrade installer experience
-clear
-echo
-echo '     _   _           _   _        ____ ____  '
-echo '    | | | | ___  ___| |_(_) __ _ / ___|  _ \ '
-echo '    | |_| |/ _ \/ __| __| |/ _` | |   | |_) |'
-echo '    |  _  |  __/\__ \ |_| | (_| | |___|  __/ '
-echo '    |_| |_|\___||___/\__|_|\__,_|\____|_|    '
-echo ""
-echo "       Hestia Control Panel Upgrade Script"
-echo "==================================================="
-echo ""
-echo "Existing files will be backed up to the following location:"
-echo "$HESTIA_BACKUP/"
-echo ""
-echo "This process may take a few moments, please wait..."
-echo ""
-
-# Set new version
-sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
-echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
-
 # Update Apache and Nginx configuration to support new file structure
+echo "(*) Updating web server configuration..."
 if [ -f /etc/apache2/apache.conf ]; then
-    echo "(*) Updating Apache configuration..."
     mv  /etc/apache2/apache.conf $HESTIA_BACKUP/conf/
     cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
 fi
 if [ -f /etc/nginx/nginx.conf ]; then
-    echo "(*) Updating Nginx configuration..."
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
     cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
 fi
 
 # Generate dhparam
 if [ ! -e /etc/ssl/dhparam.pem ]; then
-    echo "(*) Enabling HTTPS Strict Transport Security (HSTS) support..."
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
     cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
 
@@ -404,44 +359,6 @@ for user in `ls /usr/local/hestia/data/users/`; do
 	fi
 done
 
-# Upgrade phpMyAdmin if applicable
-if [ "$DB_SYSTEM" = 'mysql' ]; then
-    pma_release_file=$(ls /usr/share/phpmyadmin/RELEASE-DATE-* 2>/dev/null |tail -n 1)
-    if version_ge "${pma_release_file##*-}" "$pma_v"; then
-        echo "(*) phpMyAdmin $pma_v or newer is already installed: ${pma_release_file##*-}, skipping update..."
-    else
-        # Display upgrade information
-        echo "(*) Upgrade phpMyAdmin to v$pma_v..."
-        [ -d /usr/share/phpmyadmin ] || mkdir -p /usr/share/phpmyadmin
-
-        # Download latest phpMyAdmin release
-        wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
-
-        # Unpack files
-        tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
-
-        # Delete file to prevent error
-        rm -fr /usr/share/phpmyadmin/doc/html
-
-        # Overwrite old files
-        cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
-
-        # Set config and log directory
-        sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-        sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-
-        # Create temporary folder and change permissions
-        if [ ! -d /usr/share/phpmyadmin/tmp ]; then
-            mkdir /usr/share/phpmyadmin/tmp
-            chmod 777 /usr/share/phpmyadmin/tmp
-        fi
-
-        # Clear up
-        rm -fr phpMyAdmin-$pma_v-all-languages
-        rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
-    fi
-fi
-
 # Reset backend port
 if [ ! -z "$BACKEND_PORT" ]; then
     /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
@@ -461,43 +378,3 @@ fi
 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!'
-
-# Restart services for changes to take full effect
-echo "(*) Restarting services..."
-sleep 3
-if [ ! -z $MAIL_SYSTEM ]; then
-	$BIN/v-restart-mail $restart
-fi
-if [ ! -z $IMAP_SYSTEM ]; then
-	$BIN/v-restart-service $IMAP_SYSTEM $restart
-fi
-if [ ! -z $WEB_SYSTEM ]; then
-	$BIN/v-restart-web $restart
-	$BIN/v-restart-proxy $restart
-fi
-if [ ! -z $DNS_SYSTEM ]; then
-	$BIN/v-restart-dns $restart
-fi
-
-# 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"
-echo "    https://github.com/hestiacp/hestiacp/issues"
-echo ""
-echo "    We hope that you enjoy this release of Hestia Control Panel,"
-echo "    enjoy your day!"
-echo ""
-echo "    Sincerely,"
-echo "    The Hestia Control Panel development team"
-echo ""
-echo "    www.hestiacp.com"
-echo "    Made with love & pride by the open-source community around the world."
-echo ""
-echo ""

+ 28 - 0
install/upgrade/versions/1.00.0-190621.sh

@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Define version check function
+function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+
+# Set new version number
+NEW_VERSION="1.00.0-190621"
+
+# Set phpMyAdmin version for upgrade
+pma_v='4.9.0.1'
+
+# Set backup folder
+HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+
+# Set installation source folder
+hestiacp="$HESTIA/install/deb"
+
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf
+
+####### Place additional commands below. #######
+
+# Remove global options from nginx.conf to prevent conflicts with other web packages
+if [ -e /etc/nginx/nginx.conf ]; then
+    echo "(*) Updating nginx configuration.."
+    sed -i "/add_header          X-Frame-Options SAMEORIGIN;/d" /etc/nginx/nginx.conf
+    sed -i "/add_header          X-Content-Type-Options nosniff;/d" /etc/nginx/nginx.conf
+fi

+ 1 - 1
src/deb/hestia/control

@@ -1,7 +1,7 @@
 Source: hestia
 Package: hestia
 Priority: optional
-Version: 1.00.0-190618
+Version: 1.00.0-190621
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 36 - 9
src/deb/hestia/postinst

@@ -1,24 +1,51 @@
 #!/bin/bash
 
+# Get package version
+version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+
+# Define global variables
+source /usr/local/hestia/func/main.sh
+
+# Load message variables
+source /usr/local/hestia/install/upgrade/messages.sh
+
 # Run triggers only on updates
 if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
     exit
 fi
 
+# Set backup folder
+HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+
+# Set installation source folder
+hestiacp="$HESTIA/install/deb"
+
+# Clear the screen from apt output to prepare for upgrade installer experience
+clear
+welcome_message
+
 # Load hestia.conf
 source /usr/local/hestia/conf/hestia.conf
 
-# Get hestia version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+# Perform necessary upgrade steps
+source /usr/local/hestia/install/upgrade/version.sh
 
-# Check if upgrade routine exists for target version
-if [ -f "/usr/local/hestia/install/upgrade/$version.sh" ]; then
-    source /usr/local/hestia/install/upgrade/$version.sh
+# Upgrade phpMyAdmin if applicable
+if [ "$DB_SYSTEM" = 'mysql' ]; then
+    source /usr/local/hestia/install/upgrade/phpmyadmin.sh
 fi
 
-# Set new hestia version in conf file
-if [ "$VERSION" != "$version" ]; then
-    sed -i "s/VERSION='$VERSION'/VERSION='$version'/g" /usr/local/hestia/conf/hestia.conf
-fi
+# Set new version
+sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
+echo "VERSION='$version'" >> $HESTIA/conf/hestia.conf
+
+# Add upgrade notification to admin user's panel
+$HESTIA/bin/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to '$version'.<br>Please report any bugs on GitHub at<br><a href="https://github.com/hestiacp/hestiacp/Issues" target="_new">https://github.com/hestiacp/hestiacp/Issues</a><br><br>Have a great day!'
+
+# Restart services for changes to take full effect
+source /usr/local/hestia/install/upgrade/restart.sh
+
+# Display completion message
+upgrade_complete
 
 exit 0