mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-12 02:41:02 +01:00
Update 30-monitoring.sh
This commit is contained in:
@@ -20,7 +20,7 @@ fi
|
||||
|
||||
# Other folder if no RTSP STREAM ?
|
||||
if [ -z "${RTSP_STREAM}" ]; then
|
||||
ingest_dir=${RECS_DIR}/$(date +"%B-%Y/%d-%A")
|
||||
ingest_dir="${RECS_DIR}/$(date +"%B-%Y/%d-%A")"
|
||||
if [ ! -d "$ingest_dir" ]; then
|
||||
mkdir -p "$ingest_dir"
|
||||
chmod -R pi:pi
|
||||
@@ -46,10 +46,10 @@ while true; do
|
||||
# Pause recorder to catch-up
|
||||
############################
|
||||
|
||||
wavs=$(find ${ingest_dir} -maxdepth 1 -name '*.wav' | wc -l)
|
||||
state=$(systemctl is-active "$srv")
|
||||
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"
|
||||
echo "$(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"
|
||||
|
||||
Reference in New Issue
Block a user