]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add: check install programs
authorBastian Dehn <hhaalo@arcor.de>
Fri, 24 Nov 2017 22:09:50 +0000 (23:09 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 24 Nov 2017 22:09:50 +0000 (23:09 +0100)
albentohandy

index 219ef9f1b9aee57ded3ba7cd15ec19480248d194..4256365bf0fbb160ba5dc3465945fbb848e84238 100755 (executable)
@@ -133,11 +133,50 @@ LoadConfig() {
        fi
 }
 
+ExistsBasicProgramms() {
+       local exists=true
+
+       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
+
+       if [ $exists == false ]; then
+               exit 1
+       fi
+}
+
 main() {
        WORK="$(pwd)/work.$$" # temporary working directory
        SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script
        MUSICPATH="/tmp/musikpath" # flac collection directory
 
+       ExistsBasicProgramms
        LoadConfig
 
        ExistsScripts "$SCRIPTPATH"