Skip to content

Commit

Permalink
Update controller.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
christian1980nrw authored Oct 24, 2023
1 parent fa76f59 commit 10b309a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,17 @@ declare -A valid_vars=(
["tibber_api_key"]="string"
)

# Define a logging function and try out different methods. Maybe log_message is not available at MacOS for example.
# Define a logging function and try out different methods. Maybe log_message is not available at MacOS.
log_message() {
message="$1"
if type log_info >/dev/null 2>&1; then
log_info "$message"
elif type logger >/dev/null 2>&1; then
if [ -z "$(command -v log_info)" ]; then
logger -p user.info -t "Spotmarket-Switcher" "$message"
elif type syslog >/dev/null 2>&1; then
syslog -s "$message"
else
echo "${message:3}" >&2
log_info "$message"
fi
}


declare -A config_values

parse_and_validate_config() {
Expand Down

0 comments on commit 10b309a

Please sign in to comment.