From 14626a017439aede2f755524dd2e43e420b64aa0 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 23 Oct 2007 03:13:15 +0000 Subject: [PATCH] portability fixes for ssc script courtesy of Ulrich Spoerlein --- contrib/mt-daapd-ssc.sh | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/contrib/mt-daapd-ssc.sh b/contrib/mt-daapd-ssc.sh index c8f0176f..4cfdc4de 100755 --- a/contrib/mt-daapd-ssc.sh +++ b/contrib/mt-daapd-ssc.sh @@ -22,32 +22,21 @@ flac_file() { } FILE=$1 -OFFSET=0 - -if [ "$2" == "" ]; then - OFFSET=0 -else - OFFSET=$2 -fi - +OFFSET=${2:-0} if [ "$3" != "" ]; then FORGELEN="-l $3" fi -if ( echo $1 | grep -i "\.ogg$" > /dev/null 2>&1 ); then - ogg_file - exit; -fi - -if ( echo $1 | grep -i "\.flac$" > /dev/null 2>&1 ); then - flac_file - exit; -fi - -# +case "$1" in + *.[oO][gG][gG]) + ogg_file + ;; + *.[fF][lL][aA][cC]) + flac_file + ;; + *) # here you could cat a generic "error" wav... -# -# # cat /path/to/error.wav -# + ;; +esac