From: Bastian Dehn Date: Sun, 3 Jul 2016 17:17:16 +0000 (+0200) Subject: add: option -i albumlist X-Git-Tag: v1.0.0^2~148 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=dc2909db968f9c344fb0ec15ffd39f5a7664dbb3;p=albentohandy.git add: option -i albumlist --- diff --git a/albentohandy.sh b/albentohandy.sh index d5b4ed7..49118ab 100755 --- a/albentohandy.sh +++ b/albentohandy.sh @@ -6,6 +6,7 @@ work="$(pwd)/handy" scriptpath="/media/smbdaten1/scripts" # musicpath is collection directory musicpath="/media/smbdaten1/musik-flac" +albumlist="albumlist" parallelopts=":" curphase=1 phase=3 @@ -14,13 +15,7 @@ mkzip=false removework=false cptodest=false -if [ ! -f albumlist ] -then - printf "\nalbumlist does not exists\n\n" - exit -fi - -while getopts "m::rz::cS:" optname +while getopts "i:m::rz::cS:" optname do case "$optname" in "r") @@ -40,12 +35,21 @@ do dest="$OPTARG" phase=$((phase + 1)) ;; + "i") + albumlist="$OPTARG" + ;; "S") parallelopts="$OPTARG" ;; esac done +if [ ! -f "$albumlist" ] +then + printf "\nalbumlist does not exists\n\n" + exit +fi + printf "\nPhase %02d of %02d: create symlinks of flac's to working directory %s\n" $((curphase++)) $phase "$work" if [ ! -d $work ] @@ -54,7 +58,7 @@ then fi # make symlinks of original flac's -for i in $(cat albumlist) +for i in $(cat "$albumlist") do cp -rs $musicpath/$i $work/ done