Alexandre
2024-05-01 17:37:33 +02:00
committed by GitHub
parent 44bc0d1c69
commit a5e4045c1d
2 changed files with 13 additions and 13 deletions

View File

@@ -1,18 +1,18 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
if [ -d /tmp/StreamData ]; then
if [ -d "$HOME"/BirdSongs/StreamData ]; then
bashio::log.fatal "Container stopping, saving temporary files"
# Stop the services in parallel
systemctl stop birdnet_analysis &
systemctl stop birdnet_analysis &
systemctl stop birdnet_recording
# Check if there are files in /tmp/StreamData and move them to /data/StreamData
# Check if there are files in StreamData and move them to /data/StreamData
mkdir -p /data/StreamData
if [ "$(ls -A /tmp/StreamData)" ]; then
mv -v /tmp/StreamData/* /data/StreamData/
if [ "$(ls -A "$HOME"/BirdSongs/StreamData)" ]; then
mv -v "$HOME"/BirdSongs/StreamData/* /data/StreamData/
fi
bashio::log.fatal "... files safe, allowing container to stop"
fi