From 2dde348091645e7c4864dd7efb868617c3d76d2c Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 22:02:23 -0400 Subject: [PATCH] Update station only when set If station is blank or not set don't update the RDS setting. Removed surrounding double quotes for station setting. --- callbacks.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/callbacks.sh b/callbacks.sh index 5939ce2..0ddef52 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -78,7 +78,7 @@ power=$(grep -i "^Power\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//") rds_setting=$(grep -i "^RdsType\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/") set_frequency=$(grep -i "^SetFreq\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//") frequency=$(grep -i "^Frequency\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//") -station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//") +station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/") if [ -n "$DEBUG" ]; then @@ -192,7 +192,11 @@ case $operation in vast_args="$vast_args -f $frequency" fi if [ "x$rds_setting" != "xdisabled" ]; then - vast_args="$vast_args --rds -s $station" + if [ ${#station} -gt 0 ]; then + vast_args="$vast_args --rds -s \"$station\"" + else + vast_args="$vast_args --rds" + fi fi else echo "turn things off..."