Skip to content

Commit 02ce519

Browse files
committed
Solve issue with duplicated config keys in config at update by default
1 parent d5a33a0 commit 02ce519

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

func/syshealth.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,20 @@ function syshealth_repair_system_config() {
468468
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_CSRF_STRICTNESS ('')"
469469
$BIN/v-change-sys-config-value "POLICY_CSRF_STRICTNESS" "1"
470470
fi
471+
472+
mv $HESTIA/conf/hestia.conf $HESTIA/conf/hestia.old.conf
473+
touch $HESTIA/conf/hestia.conf
474+
while IFS='= ' read -r lhs rhs
475+
do
476+
if [[ ! $lhs =~ ^\ *# && -n $lhs ]]; then
477+
rhs="${rhs%%^\#*}" # Del in line right comments
478+
rhs="${rhs%%*( )}" # Del trailing spaces
479+
rhs="${rhs%\'*}" # Del opening string quotes
480+
rhs="${rhs#\'*}" # Del closing string quotes
481+
$BIN/v-change-sys-config-value "$lhs" "$rhs"
482+
fi
483+
done < $HESTIA/conf/hestia.old.conf
484+
rm $HESTIA/conf/hestia.old.conf
471485
}
472486

473487
# Repair System Cron Jobs

0 commit comments

Comments
 (0)