]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change: check install programm optimize
authorBastian Dehn <hhaalo@arcor.de>
Sun, 26 Nov 2017 09:34:47 +0000 (10:34 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 26 Nov 2017 09:34:47 +0000 (10:34 +0100)
albentohandy

index bd6743d77c0d2f6ca6e4feb3ce6b3f495f107acc..ed79975859ab3c80fd884a058e02ead3b61ea186 100755 (executable)
@@ -134,36 +134,14 @@ LoadConfig() {
 
 ExistsBasicProgramms() {
        local exists=true
+       local programms=("eyeD3" "flac" "lame" "sha256sum" "7z" "parallel")
 
-       if [ ! -f /usr/bin/eyeD3 ]; then
-               printf "eyeD3 not installed\n"
-               exists=false
-       fi
-
-       if [ ! -f /usr/bin/flac ]; then
-               printf "flac not installed\n"
-               exists=false
-       fi
-
-       if [ ! -f /usr/bin/lame ]; then
-               printf "lame not installed\n"
-               exists=false
-       fi
-
-       if [ ! -f /usr/bin/sha256sum ]; then
-               printf "sha256sum not installed"
-               exists=false
-       fi
-
-       if [ ! -f /usr/bin/7z ]; then
-               printf "7-zip not installed"
-               exists=false
-       fi
-
-       if [ ! -f /usr/bin/parallel ]; then
-               printf "parallel not installed"
-               exists=false
-       fi
+       for programm in $programms; do
+               if [ ! -f /usr/bin/$programm ]; then
+                       printf "$programm not installed\n"
+                       exists=false
+               fi
+       done
 
        if [ $exists == false ]; then
                exit 1