mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-19 02:58:11 +01:00
Leaner code, rsync usage
This commit is contained in:
@@ -4,12 +4,15 @@
|
||||
# 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"
|
||||
# Count the number of .wav files in /data/StreamData
|
||||
wav_count=$(find /data/StreamData -type f -name "*.wav" | wc -l)
|
||||
bashio::log.warning "Container was stopped while files were still being analyzed, restoring $wav_count .wav files"
|
||||
|
||||
# Copy files
|
||||
if [ "$(ls -A /data/StreamData)" ]; then
|
||||
if [ "$wav_count" -gt 0 ]; then
|
||||
mv -v /data/StreamData/* "$HOME"/BirdSongs/StreamData/
|
||||
fi
|
||||
|
||||
echo "... done"
|
||||
echo ""
|
||||
|
||||
@@ -21,4 +24,3 @@ if [ -d /data/StreamData ] && [ "$(ls -A /data/StreamData/)" ]; then
|
||||
rm -r /data/StreamData
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user