mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-29 02:36:05 +02:00
battybirdnet-pi
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user