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

Prevent issues with Hestia installers where hestia-php and hestia-nginx

upgrades before Hestia package and where the new hestiaweb user is missing.

Also make sure syshealth_adapt_hestia_nginx_listen_ports function is pressent
Jaap Marcus 1 год назад
Родитель
Сommit
01e61b3718
4 измененных файлов с 21 добавлено и 6 удалено
  1. 1 1
      src/deb/nginx/control
  2. 14 4
      src/deb/nginx/postinst
  3. 1 1
      src/deb/php/control
  4. 5 0
      src/deb/php/postinst

+ 1 - 1
src/deb/nginx/control

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

+ 14 - 4
src/deb/nginx/postinst

@@ -6,19 +6,29 @@ if [ "$1" != "configure" ]; then
 	exit 0
 fi
 
+# Run triggers only on updates
+if [ ! -e "/usr/local/hestia/data/users/" ]; then
+	exit
+fi
+
+# Prevent running and causes issues with outdated hestia version
+if ! id "hestiaweb" &> /dev/null; then
+	exit
+fi
+
 # Touch and set permisions on default log files on installation
 update-rc.d hestia defaults > /dev/null
 invoke-rc.d hestia start || true
 
 # Adapt Port Listing in HESTIA NGINX Backend
 source /usr/local/hestia/func/syshealth.sh # Load syshealth functions
-syshealth_adapt_hestia_nginx_listen_ports  # Adapt port listing
-syshealth_adapt_nginx_resolver
 
-# Run triggers only on updates
-if [ ! -e "/usr/local/hestia/data/users/" ]; then
+# Check if the function syshealth_adapt_hestia_nginx_listen_ports exists
+if ! declare -f syshealth_adapt_hestia_nginx_listen_ports > /dev/null; then
 	exit
 fi
+syshealth_adapt_hestia_nginx_listen_ports # Adapt port listing
+syshealth_adapt_nginx_resolver
 
 ###############################################################
 #                Initialize functions/variables               #

+ 1 - 1
src/deb/php/control

@@ -1,7 +1,7 @@
 Source: hestia-php
 Package: hestia-php
 Priority: optional
-Version: 8.3.16
+Version: 8.3.17
 Section: admin
 Maintainer: HestaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 5 - 0
src/deb/php/postinst

@@ -11,6 +11,11 @@ if [ ! -e "/usr/local/hestia/data/users/" ]; then
 	exit
 fi
 
+# Prevent running and causes issues with outdated hestia version
+if ! id "hestiaweb" &> /dev/null; then
+	exit
+fi
+
 # Check if preinstall hook exists
 if [ -e "/etc/hestiacp/hooks/php/pre_install.sh" ]; then
 	/etc/hestiacp/hooks/php/pre_install.sh