From dc2909db968f9c344fb0ec15ffd39f5a7664dbb3 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 3 Jul 2016 19:17:16 +0200 Subject: [PATCH] add: option -i albumlist --- albentohandy.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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 -- 2.47.3