mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-06 05:58:47 +02:00
Save streamdata on stop
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
#!/usr/bin/bashio
|
#!/usr/bin/bashio
|
||||||
bashio::log.fatal "Container stopping, saving temporary files"
|
|
||||||
|
|
||||||
# Stop the services in parallel
|
if [ -d /tmp/StreamData ]; then
|
||||||
systemctl stop bridnet_analysis &
|
bashio::log.fatal "Container stopping, saving temporary files"
|
||||||
systemctl stop bridnet_recording
|
|
||||||
wait 1
|
# Stop the services in parallel
|
||||||
|
systemctl stop bridnet_analysis &
|
||||||
# Check if there are files in /tmp/StreamData and move them to /data/StreamData
|
systemctl stop bridnet_recording
|
||||||
if [ "$(ls -A /tmp/StreamData)" ]; then
|
wait 1
|
||||||
cp -rnf /tmp/StreamData/* /data/StreamData/
|
|
||||||
|
# Check if there are files in /tmp/StreamData and move them to /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
|
fi
|
||||||
|
|
||||||
bashio::log.fatal "... files safe, allowing container to stop"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user