mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-14 11:31:31 +02:00
Use colored logs
This commit is contained in:
@@ -50,14 +50,14 @@ while true; do
|
|||||||
wavs="$(find "${ingest_dir}" -maxdepth 1 -name '*.wav' | wc -l)"
|
wavs="$(find "${ingest_dir}" -maxdepth 1 -name '*.wav' | wc -l)"
|
||||||
state="$(systemctl is-active "$srv")"
|
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
|
if (( wavs > 100 )) && [[ "$state" == "active" ]]; then
|
||||||
sudo systemctl stop "$srv"
|
sudo systemctl stop "$srv"
|
||||||
echo "$(date) WARNING stopped $srv service"
|
bashio::log.red "$(date) WARNING stopped $srv service"
|
||||||
elif (( wavs <= 100 )) && [[ "$state" == "inactive" ]]; then
|
elif (( wavs <= 100 )) && [[ "$state" == "inactive" ]]; then
|
||||||
sudo systemctl start $srv
|
sudo systemctl start $srv
|
||||||
echo "$(date) INFO started $srv service"
|
bashio::log.yellow "$(date) INFO started $srv service"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
((counter--))
|
((counter--))
|
||||||
|
|||||||
Reference in New Issue
Block a user