mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-04 04:58:46 +02:00
Create 02-restorestreamdata
This commit is contained in:
20
birdnet-pi/rootfs/etc/cont-init.d/02-restorestreamdata
Normal file
20
birdnet-pi/rootfs/etc/cont-init.d/02-restorestreamdata
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user