changed dockerfile and init-cp run

This commit is contained in:
Richard Sperry 2025-04-15 15:38:22 -07:00
parent 2b3e7447a0
commit 69f3b3cc23
2 changed files with 11 additions and 4 deletions

View file

@ -38,9 +38,9 @@ services:
- mysql:want
- mqtt:want
options:
log_level: Warn
log_level: warn
schema:
log_level: list(trace|debug|info|Warn|error)
log_level: list(trace|debug|info|notice|warning|error|fatal)?
config_path: str?
packages:
- str?

View file

@ -53,8 +53,15 @@ fi
if bashio::config.has_value 'log_level'; then
log_level=$(bashio::config 'log_level')
# shellcheck disable=SC2001
log_level="$(echo "$log_level" | sed 's/.*/\u&/')"
if [ "$log_level" = "warning" ] ; then
log_level="warn"
fi
if [ "$log_level" = "notice" ] ; then
log_level="warn"
fi
if [ "$log_level" = "fatal" ] ; then
log_level="error"
fi
sed -i "/log=/c log=\"$log_level\"" "$CODE_SERVER_CONFIG"
fi