…blah

#!/bin/bash
#
#
#   Silly little script to grab Coffeebreak from the current "Podcast Host" 
#   and import it into my local Rivendell install.
#
#   Since there isn't a feed to grab from, gotta grab the files based on date;
#   ...and since I couldn't get Rivendell to compile with m4a support, 
#   I have to convert it to a format that Riv' will ingest. 
#
#
DAYOFWEEK=$(date +"%a")

if [ "${DAYOFWEEK}" == Mon ];  then    
    wget https://ice64.securenetsystems.net/media/WCYNAM/ondemand/CB-MON.m4a
    ffmpeg -i CB-MON.m4a CB-MON.wav
    rm CB-MON.m4a
    rdimport --verbose --segue-level=-10 --delete-cuts --delete-source --to-cart=070003 SHOWS CB-MON.wav; 
fi
if [ "${DAYOFWEEK}" == Tue ];  then
    wget https://ice64.securenetsystems.net/media/WCYNAM/ondemand/CB-TUES.m4a
    ffmpeg -i CB-TUES.m4a CB-TUES.wav
    rm CB-TUES.m4a
    rdimport --verbose --segue-level=-10 --delete-cuts --delete-source --to-cart=070003 SHOWS CB-TUES.wav; 
fi
if [ "${DAYOFWEEK}" == Wed ];  then
    wget https://ice64.securenetsystems.net/media/WCYNAM/ondemand/CB-WED.m4a
    ffmpeg -i CB-WED.m4a CB-WED.wav
    rm CB-WED.m4a
    rdimport --verbose --segue-level=-10 --delete-cuts --delete-source --to-cart=070003 SHOWS CB-WED.wav; 
fi
if [ "${DAYOFWEEK}" == Thu ];  then
    wget https://ice64.securenetsystems.net/media/WCYNAM/ondemand/CB-THURS.m4a
    ffmpeg -i CB-THURS.m4a CB-THURS.wav
    rm CB-THURS.m4a
    rdimport --verbose --segue-level=-10 --delete-cuts --delete-source --to-cart=070003 SHOWS CB-THURS.wav; 
fi
if [ "${DAYOFWEEK}" == Fri ];  then
    wget https://ice64.securenetsystems.net/media/WCYNAM/ondemand/CB-FRI.m4a
    ffmpeg -i CB-FRI.m4a CB-FRI.wav
    rm CB-FRI.m4a
    rdimport --verbose --segue-level=-10 --delete-cuts --delete-source --to-cart=070003 SHOWS CB-FRI.wav; 
fi

exit 0