Skip to content

Commit

Permalink
Update station only when set
Browse files Browse the repository at this point in the history
If station is blank or not set don't update the RDS setting. Removed
surrounding double quotes for station setting.
  • Loading branch information
jasoveen committed Oct 5, 2016
1 parent 886e1d8 commit 2dde348
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions callbacks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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..."
Expand Down

0 comments on commit 2dde348

Please sign in to comment.