diff options
-rwxr-xr-x | encode-jack-dls.sh | 13 | ||||
-rwxr-xr-x | encode-jack.sh | 13 | ||||
-rwxr-xr-x | launch-all-encoders.sh | 2 | ||||
-rwxr-xr-x | radio.sh | 4 | ||||
-rwxr-xr-x | start-mux-mod.sh | 4 |
5 files changed, 17 insertions, 19 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 diff --git a/encode-jack.sh b/encode-jack.sh index 3836a84..f6d822d 100755 --- a/encode-jack.sh +++ b/encode-jack.sh @@ -20,13 +20,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 @@ -47,12 +47,11 @@ 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 -encoderalive=0 mplayerpid=0 encoderpid=0 running=1 @@ -88,10 +87,10 @@ 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" & 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" & mplayerpid=$! fi @@ -221,7 +220,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 was restarted at $NOW diff --git a/launch-all-encoders.sh b/launch-all-encoders.sh index ec365cf..e4ca3db 100755 --- a/launch-all-encoders.sh +++ b/launch-all-encoders.sh @@ -11,7 +11,7 @@ then for radio in ${all_radios[*]} do echo "Launching $radio encoder" - screen -t $radio ./radio.sh $radio + screen -t "$radio" ./radio.sh "$radio" sleep 0.4 done @@ -27,7 +27,7 @@ sigint_trap() { set -e # check number of arguments -if [[ "$#" < 1 ]] ; then +if [[ "$#" -lt 1 ]] ; then echo "Usage $0 radio-id" echo "You must specify which radio to start" exit 1 @@ -35,7 +35,7 @@ fi RADIO=$1 -if [ ${radios[$RADIO]+_} ] ; then +if [ "${radios[$RADIO]+_}" ] ; then COMMAND=${radios[$RADIO]} trap sigint_trap SIGINT diff --git a/start-mux-mod.sh b/start-mux-mod.sh index c7f2489..96e05c2 100755 --- a/start-mux-mod.sh +++ b/start-mux-mod.sh @@ -2,7 +2,7 @@ # # Launch the multiplexer and the modulator -if [[ -e site/multiplex.mux && -e site/mod.ini && site/mail-warning.txt ]] +if [[ -e site/multiplex.mux && -e site/mod.ini && -e site/mail-warning.txt ]] then while true @@ -14,7 +14,7 @@ then if [[ "$MAILTO" != "" ]] ; then NOW=$(date) - mail -s "MUX and MOD restart" $MAILTO << EOF + mail -s "MUX and MOD restart" "$MAILTO" << EOF The mux and mod were restarted at $NOW |