diff --git a/testdata/moonfire-nvr/movement_detection_via_api_ffmpeg.sh b/testdata/moonfire-nvr/movement_detection_via_api_ffmpeg.sh index 919c7aa..e5be156 100644 --- a/testdata/moonfire-nvr/movement_detection_via_api_ffmpeg.sh +++ b/testdata/moonfire-nvr/movement_detection_via_api_ffmpeg.sh @@ -1,5 +1,11 @@ #! /bin/bash +set -euo pipefail + +if test -f /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh; then + bash /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh +fi + main() { local nonrecent_unix="$(($(_date +%s) - 4 * 60 * 60))" # 4h ago local nonrecent_ts="$(_date -d @$nonrecent_unix -u +%Y-%m-%dT%H:%M:%SZ)" @@ -93,6 +99,4 @@ _date() { fi } -if [ "$0" == "$BASH_SOURCE" ]; then - main "$@" -fi +main "$@"