Skip to content

Commit 71c2027

Browse files
author
Kristan Kenney
committed
Add write/read config value functions
1 parent a1b45b5 commit 71c2027

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

func/syshealth.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
# Hestia Control Panel - System Health Check Function Library
44

5+
# Read known configuration keys from $HESTIA/conf/defaults/$system.conf
6+
function read_kv_config_file () {
7+
local system=$1
8+
while read -r str; do
9+
echo "$str"
10+
done < <(cat $HESTIA/conf/defaults/$system.conf)
11+
unset system
12+
}
513

614
# Write known configuration keys to $HESTIA/conf/defaults/
715
function write_kv_config_file () {
@@ -116,6 +124,15 @@ function syshealth_update_ip_config_format () {
116124
unset known_keys
117125
}
118126

127+
# Sanitize web domain configuration
128+
function syshealth_sanitize_config() {
129+
local system=$1
130+
known_keys=$(read_kv_config_file "$system")
131+
for key in $known_keys; do
132+
unset $key
133+
done
134+
}
135+
119136
# Repair System Configuration
120137
# Adds missing variables to $HESTIA/conf/hestia.conf with safe default values
121138
function syshealth_repair_system_config () {

0 commit comments

Comments
 (0)