Explorar o código

Fix error in rebuild script (#3639)

* Update check

* Remove not needed check

* Fix bug in sync system

* Resolve sync issue for real
Jaap Marcus %!s(int64=2) %!d(string=hai) anos
pai
achega
c8eeae599f
Modificáronse 3 ficheiros con 9 adicións e 14 borrados
  1. 6 9
      bin/v-update-web-templates
  2. 1 3
      func/rebuild.sh
  3. 2 2
      func/syshealth.sh

+ 6 - 9
bin/v-update-web-templates

@@ -29,11 +29,15 @@ source_conf "$HESTIA/conf/hestia.conf"
 # Check if /install/upgrade/manual/install_awstats_geoip.sh has been applied
 awstats_patch=$(cat $HESTIA/data/templates/web/awstats/awstats.tpl | grep "LoadPlugin=\"geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat\"")
 
-# Update templates
-if [ -d "${WEBTPL}" ]; then
+# Skeleton, Unassinged and Suspended
+if [ "$POLICY_SYNC_SKELETON" != "no" ]; then
 	rm -rf "${WEBTPL}/skel" 2> /dev/null
 	rm -rf "${WEBTPL}/suspend" 2> /dev/null
 	rm -rf "${WEBTPL}/unassigned" 2> /dev/null
+
+	for webtpl_folder in $(ls $HESTIA_COMMON_DIR/templates/web/* -d 2> /dev/null); do
+		cp -rf "${webtpl_folder}" "${WEBTPL}/"
+	done
 fi
 
 [ -d "${WEBTPL}/nginx" ] || mkdir -p "${WEBTPL}/nginx"
@@ -46,13 +50,6 @@ for webtpl_folder in $(ls $HESTIA_INSTALL_DIR/templates/web/* -d 2> /dev/null |
 	cp -rf "${webtpl_folder}" "${WEBTPL}/"
 done
 
-# Skeleton, Unassinged and Suspended
-if [ "$POLICY_SYNC_SKELETON" != "no" ]; then
-	for webtpl_folder in $(ls $HESTIA_COMMON_DIR/templates/web/* -d 2> /dev/null); do
-		cp -rf "${webtpl_folder}" "${WEBTPL}/"
-	done
-fi
-
 versions_list=$(ls -d /etc/php/*)
 for php_ver in $versions_list; do
 	[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue

+ 1 - 3
func/rebuild.sh

@@ -261,9 +261,7 @@ rebuild_web_domain_conf() {
 	if [ ! -d "$HOMEDIR/$user/web/$domain/document_errors" ]; then
 		$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/document_errors"
 		# Propagating html skeleton
-		if [ -d "$WEBTPL/skel/document_errors/" ]; then
-			user_exec cp -r "$WEBTPL/skel/document_errors/" "$HOMEDIR/$user/web/$domain/"
-		fi
+		user_exec cp -r "$WEBTPL/skel/document_errors/*" "$HOMEDIR/$user/web/$domain/document_errors/"
 	fi
 	$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/cgi-bin"
 	$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/private"

+ 2 - 2
func/syshealth.sh

@@ -514,12 +514,12 @@ function syshealth_repair_system_config() {
 
 	if [[ -z $(check_key_exists 'POLICY_SYNC_ERROR_DOCUMENTS') ]]; then
 		echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_ERROR_DOCUMENTS ('yes')"
-		$BIN/v-change-sys-config-value "POLICY_SYNC_ERROR_DOCUMENTS" "no"
+		$BIN/v-change-sys-config-value "POLICY_SYNC_ERROR_DOCUMENTS" "yes"
 	fi
 
 	if [[ -z $(check_key_exists 'POLICY_SYNC_SKELETON') ]]; then
 		echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_SKELETON ('yes')"
-		$BIN/v-change-sys-config-value "POLICY_SYNC_SKELETON" "no"
+		$BIN/v-change-sys-config-value "POLICY_SYNC_SKELETON" "yes"
 	fi
 
 	touch $HESTIA/conf/hestia.conf.new