]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add: option -i albumlist
authorBastian Dehn <hhaalo@arcor.de>
Sun, 3 Jul 2016 17:17:16 +0000 (19:17 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 3 Jul 2016 17:17:16 +0000 (19:17 +0200)
albentohandy.sh

index d5b4ed7ba4f4365da4bcfb06e9c9dbe80ad09cd2..49118abbc4ac885bedf000f74b07e15b7ce8d477 100755 (executable)
@@ -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