Skip to content
Snippets Groups Projects
Commit b27e3ce1 authored by Bob Mottram's avatar Bob Mottram
Browse files

Run icecast conversions as a separate process

parent 365b4062
No related branches found
No related tags found
No related merge requests found
......@@ -1786,17 +1786,21 @@ function update_icecast {
fi
backup_unmount_drive
if [ $icecast_playlist_updated ]; then
cd "$ICECAST_DIR" || return
# 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
# 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"
{ echo '#!/bin/bash';
echo '/usr/bin/stop_icecast';
echo "cd \"$ICECAST_DIR\" || exit 3542";
echo '# Converting any mp3 files to ogg format';
echo "find . -type f -name '*.mp3' -exec bash -c 'ffmpeg -i \"\$0\" -c:a libvorbis -q:a 4 \"\${0/%mp3/ogg}\"' '{}' \\;";
echo "find . -name \"*.mp3\" -print0 | xargs -0 rm -f";
echo '# Converting any mp4 files to ogv format';
echo "find . -type f -name '*.mp4' -exec bash -c 'ffmpeg -i \"\$0\" -c:a libvorbis -q:a 4 \"\${0/%mp3/ogv}\"' '{}' \\;";
echo "find . -name \"*.mp4\" -print0 | xargs -0 rm -f";
echo "chown -R icecast2:icecast \"$ICECAST_DIR\"";
echo '/usr/bin/start_icecast';} > /root/webadmin_icecast.sh
chmod +x /root/webadmin_icecast.sh
./root/webadmin_icecast.sh &
rm "$icecast_file"
return
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment