Create 02-restorestreamdata

This commit is contained in:
Alexandre
2024-05-01 15:56:22 +02:00
committed by GitHub
parent 097245bcc0
commit a89a603f2a

View File

@@ -0,0 +1,20 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# Check if there are files in /tmp/StreamData and move them to /data/StreamData
if [ -d /data/StreamData ] && [ "$(ls -A /tmp/StreamData)" ]; then
bashio::log.warning "Container was stopped while files were still being analysed, restoring them"
# Copy files
if [ "$(ls -A /data/StreamData)" ]; then
mv /data/StreamData/* /tmp/StreamData/
fi
echo "... done"
echo ""
# Cleaning folder
rm -r /data/StreamData
fi