Browse Source

Improve update text (#2270)

* Do not restart phpfpm when modphp is installed

* Synchronise upgrade messages

* Replace sed with slightly narrow sed

Issue caused with Vultr not working under Deb11

* Apply fix also to v-change-firewall-rule

See #2249 for reason why

* Remove space at the end.

Co-authored-by: Raphael Schneeberger <rs@scit.ch>
Jaap Marcus 4 years ago
parent
commit
de2a825dbe
4 changed files with 22 additions and 19 deletions
  1. 1 1
      bin/v-change-firewall-rule
  2. 3 2
      bin/v-delete-sys-filemanager
  3. 17 15
      func/upgrade.sh
  4. 1 1
      install/hst-install-debian.sh

+ 1 - 1
bin/v-change-firewall-rule

@@ -53,7 +53,7 @@ is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
 
 if [[ "$ip" =~ ^ipset: ]]; then
     ipset_name="${ip#ipset:}"
-    v-list-firewall-ipset plain | grep "^$ipset_name\s" >/dev/null
+    $BIN/v-list-firewall-ipset plain | grep "^$ipset_name\s" >/dev/null
     check_result $? 'ipset object not found' "$E_NOTEXIST"
 else
     is_format_valid 'ip'

+ 3 - 2
bin/v-delete-sys-filemanager

@@ -12,6 +12,7 @@
 #----------------------------------------------------------#
 
 MODE=$1
+FORCE=$2
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -47,12 +48,12 @@ fi
 check_hestia_demo_mode
 
 # Check if File Manager components are installed
-if [ "$MODE" != "force" ] && [ ! -e "$FM_INSTALL_DIR" ]; then
+if [ "$FORCE" != "yes" ] && [ ! -e "$FM_INSTALL_DIR" ]; then
     echo "ERROR: File Manager components are not installed."
     exit 1
 fi
 
-if [ "$MODE" != "force" ] && [ "$FILE_MANGER" = "false" ]; then
+if [ "$FORCE" != "yes" ] && [ "$FILE_MANGER" = "false" ]; then
     echo "ERROR: File Manager is not enabled."
     exit 1
 fi

+ 17 - 15
func/upgrade.sh

@@ -548,7 +548,7 @@ upgrade_phpmyadmin() {
 
         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 "[ ! ] Verifying phpMyAdmin v${pma_release_file##*-} installation..., No update found"
+            echo "[ * ] Verify phpMyAdmin v${pma_release_file##*-} installation, No update found"
             # Update permissions
             if [ -e /var/lib/phpmyadmin/blowfish_secret.inc.php ]; then
                 chown root:www-data /var/lib/phpmyadmin/blowfish_secret.inc.php
@@ -604,16 +604,16 @@ upgrade_filemanager() {
         fm_verison="1.0.0"
         fi
         if [ "$fm_verison" != "$fm_v" ]; then 
-            echo "[ * ] Updating File Manager..."
+            echo "[ ! ] Updating File Manager..."
             # Reinstall the File Manager
-            $HESTIA/bin/v-delete-sys-filemanager quiet
+            $HESTIA/bin/v-delete-sys-filemanager quiet yes
             $HESTIA/bin/v-add-sys-filemanager quiet
         else
             echo "[ * ] Verify version Filemanager, No update found"
             
             if [ "$UPGRADE_UPDATE_FILEMANAGER_CONFIG" = "true" ]; then
                 if [ -e "$HESTIA/web/fm/configuration.php" ]; then
-                    echo "[ * ] Updating File Manager configuration..."
+                    echo "[ ! ] Updating File Manager configuration..."
                     # Update configuration.php
                     cp -f $HESTIA_INSTALL_DIR/filemanager/filegator/configuration.php $HESTIA/web/fm/configuration.php
                     # Set environment variable for interface
@@ -627,11 +627,11 @@ upgrade_filemanager() {
 upgrade_roundcube(){
     if [ -n "$(echo "$WEBMAIL_SYSTEM" | grep -w 'roundcube')" ]; then
         if [ -d "/usr/share/roundcube" ]; then
-            echo "[ ! ] Roundcube: Unable to update. Updates are managed by apt.";
+            echo "[ * ] Roundcube: Unable to update. Updates are managed by apt.";
         else
             rc_version=$(cat /var/lib/roundcube/index.php | grep -o -E '[0-9].[0-9].[0-9]+' | head -1);
             if [ "$rc_version" != "$rc_v" ]; then
-                echo "[ * ] Upgrading Roundcube to version v$rc_v..."
+                echo "[ ! ] Upgrading Roundcube to version v$rc_v..."
                 $HESTIA/bin/v-add-sys-roundcube
             else
                 echo "[ * ] Verify version Roundcube, No update found"
@@ -644,7 +644,7 @@ upgrade_rainloop(){
     if [ -n "$(echo "$WEBMAIL_SYSTEM" | grep -w 'rainloop')" ]; then
         rl_version=$(cat /var/lib/rainloop/data/VERSION);
         if [ "$rl_version" != "$rl_v" ]; then
-            echo "[ * ] Upgrading Rainloop to version v$rl_v..."
+            echo "[ ! ] Upgrading Rainloop to version v$rl_v..."
             $HESTIA/bin/v-add-sys-rainloop
         else
             echo "[ * ] Verify version Rainloop, No update found"
@@ -659,7 +659,7 @@ upgrade_phpmailer(){
     fi
     phpm_version=$(cat $HESTIA/web/inc/vendor/phpmailer/phpmailer/VERSION);
     if [ "$phpm_version" != "$pm_v" ]; then
-    echo "[ * ] Upgrade phpmailer"
+    echo "[ ! ] Upgrade phpmailer"
         $HESTIA/bin/v-add-sys-phpmailer
     else
         echo "[ * ] Verify Version phpmailer No update found"
@@ -779,13 +779,15 @@ upgrade_restart_services() {
             fi
             $BIN/v-restart-dns 'yes'
         fi
-        versions_list=$($BIN/v-list-sys-php plain)
-        for v in $versions_list; do 
-            if [ "$DEBUG_MODE" = "true" ]; then
-                echo "      - php$v-fpm"
-            fi
-            $BIN/v-restart-service "php$v-fpm" 'yes'
-        done
+        if [ -n "$WEB_BACKEND" ]; then 
+            versions_list=$($BIN/v-list-sys-php plain)
+            for v in $versions_list; do 
+                if [ "$DEBUG_MODE" = "true" ]; then
+                    echo "      - php$v-fpm"
+                fi
+                $BIN/v-restart-service "php$v-fpm" 'yes'
+            done
+        fi 
         if [ -n "$FTP_SYSTEM" ]; then
             if [ "$DEBUG_MODE" = "true" ]; then
                 echo "      - $FTP_SYSTEM"

+ 1 - 1
install/hst-install-debian.sh

@@ -1274,7 +1274,7 @@ check_result $? "can't enable sftp jail"
 # Switch to sha512 for deb11.
 if [ "$release" -eq 11 ]; then
     # Switching to sha512
-    sed -i "s/obscure yescrypt/obscure sha512/g" /etc/pam.d/common-password
+    sed -i "s/ yescrypt/ sha512/g" /etc/pam.d/common-password
 fi
 
 # Adding Hestia admin account