From 0f5803abc97b0e1ed40d702de7cc92fffc052971 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sat, 25 Nov 2017 22:31:16 +0000
Subject: [PATCH] Remove source stream files after conversion

---
 src/freedombone-app-icecast | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/freedombone-app-icecast b/src/freedombone-app-icecast
index 0cd050e7c..92add3729 100755
--- a/src/freedombone-app-icecast
+++ b/src/freedombone-app-icecast
@@ -123,9 +123,11 @@ function icecast_convert_files {
 
     echo $'Converting any mp3 files to ogg format'
     find . -type f -name '*.mp3' -exec bash -c 'ffmpeg -i "$0" -c:a libvorbis -q:a 4 "${0/%mp3/ogg}"' '{}' \;
+    find . -name "*.mp3" -print0 | xargs -0 rm -f
 
     echo $'Converting any mp4 files to ogv format'
     find . -type f -name '*.mp4' -exec bash -c 'ffmpeg -i "$0" -c:a libvorbis -q:a 4 "${0/%mp3/ogv}"' '{}' \;
+    find . -name "*.mp4" -print0 | xargs -0 rm -f
 
     chown -R icecast2:icecast $ICECAST_DIR
 }
-- 
GitLab