mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-14 11:31:31 +02:00
Change location
This commit is contained in:
@@ -29,13 +29,13 @@ if [ -d "$HOME"/BirdSongs/StreamData ]; then
|
|||||||
wait
|
wait
|
||||||
|
|
||||||
# Create the destination directory
|
# Create the destination directory
|
||||||
mkdir -p /data/StreamData
|
mkdir -p /config/TemporaryFiles
|
||||||
|
|
||||||
# Move only valid WAV files under 50MB
|
# Move only valid WAV files under 50MB
|
||||||
shopt -s nullglob # Prevent errors if no files match
|
shopt -s nullglob # Prevent errors if no files match
|
||||||
for file in "$HOME"/BirdSongs/StreamData/*.wav; do
|
for file in "$HOME"/BirdSongs/StreamData/*.wav; do
|
||||||
if [ -f "$file" ] && [ "$(stat --format="%s" "$file")" -lt "$MAX_SIZE" ] && is_valid_wav "$file"; then
|
if [ -f "$file" ] && [ "$(stat --format="%s" "$file")" -lt "$MAX_SIZE" ] && is_valid_wav "$file"; then
|
||||||
if mv -v "$file" /data/StreamData/; then
|
if mv -v "$file" /config/TemporaryFiles/; then
|
||||||
bashio::log.info "Moved valid WAV file: $(basename "$file")"
|
bashio::log.info "Moved valid WAV file: $(basename "$file")"
|
||||||
else
|
else
|
||||||
bashio::log.error "Failed to move: $(basename "$file")"
|
bashio::log.error "Failed to move: $(basename "$file")"
|
||||||
|
|||||||
Reference in New Issue
Block a user