Use colored logs

This commit is contained in:
Alexandre
2024-05-01 20:54:32 +02:00
committed by GitHub
parent 4b5c48cea4
commit f8e92afb62

View File

@@ -50,14 +50,14 @@ while true; do
wavs="$(find "${ingest_dir}" -maxdepth 1 -name '*.wav' | wc -l)"
state="$(systemctl is-active "$srv")"
echo "$(date) INFO ${wavs} wav files waiting in $(readlink -f "$ingest_dir"), $srv state is $state"
bashio::log.green "$(date) INFO ${wavs} wav files waiting in $(readlink -f "$ingest_dir"), $srv state is $state"
if (( wavs > 100 )) && [[ "$state" == "active" ]]; then
sudo systemctl stop "$srv"
echo "$(date) WARNING stopped $srv service"
bashio::log.red "$(date) WARNING stopped $srv service"
elif (( wavs <= 100 )) && [[ "$state" == "inactive" ]]; then
sudo systemctl start $srv
echo "$(date) INFO started $srv service"
bashio::log.yellow "$(date) INFO started $srv service"
fi
((counter--))