diff options
Diffstat (limited to 'encode-jack-dls.sh')
-rwxr-xr-x | encode-jack-dls.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/encode-jack-dls.sh b/encode-jack-dls.sh index 848f25a..7b8f8c9 100755 --- a/encode-jack-dls.sh +++ b/encode-jack-dls.sh @@ -22,13 +22,13 @@ printmsg() { set -u # check number of arguments -if [[ "$#" < 3 ]] ; then +if [[ "$#" -lt 3 ]] ; then echo "Usage $0 url jack-id destination [volume] [encoder]" echo "The volume setting is optional" exit 1 fi -if [[ "$#" > 2 ]] ; then +if [[ "$#" -gt 2 ]] ; then URL=$1 ID=$2 DST=$3 @@ -49,7 +49,7 @@ fi BITRATE=80 RATE=32 #kHz -if [[ "$ENC" == "toolame" && "RATE" == "32" ]] ; then +if [[ "$ENC" == "toolame" && "$RATE" == "32" ]] ; then echo "32kHz not supported for toolame" exit 1 fi @@ -57,7 +57,6 @@ fi DLSDIR=site/dls SLIDEDIR=site/slide -encoderalive=0 mplayerpid=0 encoderpid=0 motencoderpid=0 @@ -100,11 +99,11 @@ while [[ "$running" == "1" ]] do if [[ "$mplayerpid" == "0" ]] ; then if [[ "$VOL" == "0" ]] ; then - mplayer -quiet -af resample=${RATE}000:0:2 -ao jack:name=$ID $URL | \ + mplayer -quiet -af resample=${RATE}000:0:2 -ao jack:name=$ID "$URL" | \ ./icy-info.py $DLSDIR/${ID}.dls $DLSDIR/${ID}-default.dls & mplayerpid=$! else - mplayer -quiet -af resample=${RATE}000:0:2 -af volume=$VOL -ao jack:name=$ID $URL | \ + mplayer -quiet -af resample=${RATE}000:0:2 -af volume=$VOL -ao jack:name=$ID "$URL" | \ ./icy-info.py $DLSDIR/${ID}.dls $DLSDIR/${ID}-default.dls & mplayerpid=$! fi @@ -276,7 +275,7 @@ do if [[ "$MAILTO" != "" ]] ; then NOW=$(date) - mail -s "Encoder $ID restart $URL" $MAILTO << EOF + mail -s "Encoder $ID restart $URL" "$MAILTO" << EOF The encoder id:$ID encoding $URL -> $DST using encode-jack-dls was restarted at $NOW |