mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-28 02:06:04 +02:00
clean
This commit is contained in:
19
birdnet-pi/rootfs/etc/cont-finish.d/savestreamdata.sh
Normal file
19
birdnet-pi/rootfs/etc/cont-finish.d/savestreamdata.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
if [ -d /tmp/StreamData ]; then
|
||||
bashio::log.fatal "Container stopping, saving temporary files"
|
||||
|
||||
# Stop the services in parallel
|
||||
systemctl stop bridnet_analysis &
|
||||
systemctl stop bridnet_recording
|
||||
wait 1
|
||||
|
||||
# Check if there are files in /tmp/StreamData and move them to /data/StreamData
|
||||
mkdir -p /data/StreamData
|
||||
if [ "$(ls -A /tmp/StreamData)" ]; then
|
||||
cp -rnf /tmp/StreamData/* /data/StreamData/
|
||||
fi
|
||||
|
||||
bashio::log.fatal "... files safe, allowing container to stop"
|
||||
fi
|
||||
Reference in New Issue
Block a user