mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
25 lines
640 B
Bash
25 lines
640 B
Bash
#!/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 /data/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
|
|
chmod -R 755 "$HOME"/BirdSongs
|
|
|
|
# Cleaning folder
|
|
rm -r /data/StreamData
|
|
|
|
fi
|
|
|