mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-19 11:08:11 +01:00
24 lines
616 B
Bash
Executable File
24 lines
616 B
Bash
Executable File
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
|
|
# Check if there are files in "$HOME"/BirdSongs/StreamData and move them to /data/StreamData
|
|
if [ -d /data/StreamData ] && [ "$(ls -A "$HOME"/BirdSongs/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 -v /data/StreamData/* "$HOME"/BirdSongs/StreamData/
|
|
fi
|
|
echo "... done"
|
|
echo ""
|
|
|
|
# Setting permissions
|
|
chown -R pi:pi "$HOME"/BirdSongs
|
|
|
|
# Cleaning folder
|
|
rm -r /data/StreamData
|
|
|
|
fi
|
|
|