Skip to content

Commit c8eeae5

Browse files
authored
Fix error in rebuild script (hestiacp#3639)
* Update check * Remove not needed check * Fix bug in sync system * Resolve sync issue for real
1 parent aa7b138 commit c8eeae5

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

bin/v-update-web-templates

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ source_conf "$HESTIA/conf/hestia.conf"
2929
# Check if /install/upgrade/manual/install_awstats_geoip.sh has been applied
3030
awstats_patch=$(cat $HESTIA/data/templates/web/awstats/awstats.tpl | grep "LoadPlugin=\"geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat\"")
3131

32-
# Update templates
33-
if [ -d "${WEBTPL}" ]; then
32+
# Skeleton, Unassinged and Suspended
33+
if [ "$POLICY_SYNC_SKELETON" != "no" ]; then
3434
rm -rf "${WEBTPL}/skel" 2> /dev/null
3535
rm -rf "${WEBTPL}/suspend" 2> /dev/null
3636
rm -rf "${WEBTPL}/unassigned" 2> /dev/null
37+
38+
for webtpl_folder in $(ls $HESTIA_COMMON_DIR/templates/web/* -d 2> /dev/null); do
39+
cp -rf "${webtpl_folder}" "${WEBTPL}/"
40+
done
3741
fi
3842

3943
[ -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 |
4650
cp -rf "${webtpl_folder}" "${WEBTPL}/"
4751
done
4852

49-
# Skeleton, Unassinged and Suspended
50-
if [ "$POLICY_SYNC_SKELETON" != "no" ]; then
51-
for webtpl_folder in $(ls $HESTIA_COMMON_DIR/templates/web/* -d 2> /dev/null); do
52-
cp -rf "${webtpl_folder}" "${WEBTPL}/"
53-
done
54-
fi
55-
5653
versions_list=$(ls -d /etc/php/*)
5754
for php_ver in $versions_list; do
5855
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue

func/rebuild.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,7 @@ rebuild_web_domain_conf() {
261261
if [ ! -d "$HOMEDIR/$user/web/$domain/document_errors" ]; then
262262
$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/document_errors"
263263
# Propagating html skeleton
264-
if [ -d "$WEBTPL/skel/document_errors/" ]; then
265-
user_exec cp -r "$WEBTPL/skel/document_errors/" "$HOMEDIR/$user/web/$domain/"
266-
fi
264+
user_exec cp -r "$WEBTPL/skel/document_errors/*" "$HOMEDIR/$user/web/$domain/document_errors/"
267265
fi
268266
$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/cgi-bin"
269267
$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/private"

func/syshealth.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,12 @@ function syshealth_repair_system_config() {
514514

515515
if [[ -z $(check_key_exists 'POLICY_SYNC_ERROR_DOCUMENTS') ]]; then
516516
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_ERROR_DOCUMENTS ('yes')"
517-
$BIN/v-change-sys-config-value "POLICY_SYNC_ERROR_DOCUMENTS" "no"
517+
$BIN/v-change-sys-config-value "POLICY_SYNC_ERROR_DOCUMENTS" "yes"
518518
fi
519519

520520
if [[ -z $(check_key_exists 'POLICY_SYNC_SKELETON') ]]; then
521521
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_SKELETON ('yes')"
522-
$BIN/v-change-sys-config-value "POLICY_SYNC_SKELETON" "no"
522+
$BIN/v-change-sys-config-value "POLICY_SYNC_SKELETON" "yes"
523523
fi
524524

525525
touch $HESTIA/conf/hestia.conf.new

0 commit comments

Comments
 (0)