This commit is contained in:
6543 2019-02-07 22:16:45 +01:00
parent ba3ac3b276
commit 00bcaff33d

View File

@ -48,7 +48,7 @@ if [ "$mode" == "help" ] && help
[ -z "$moviedir" ] && [ -f "$globalconf" ] && { # if (no argument) and (globalconf exist) [ -z "$moviedir" ] && [ -f "$globalconf" ] && { # if (no argument) and (globalconf exist)
if [ -z "$(grep "moviedir=" "$globalconf" )" ]; then # and (moviedir is NOT in globalconf) if [ -z "$(grep "moviedir=" "$globalconf" )" ]; then # and (moviedir is NOT in globalconf)
echo 'neither "movie folder" is set in global config nor given as argument' echo 'neither "movie folder" is set in global config nor given as argument'
exit 2 exit 2
else # and (moviedir is in globalconf) else # and (moviedir is in globalconf)
moviedir="$(grep "moviedir=" "$globalconf" | cut -d '=' -f 2)" moviedir="$(grep "moviedir=" "$globalconf" | cut -d '=' -f 2)"
fi fi
@ -57,23 +57,23 @@ if [ "$mode" == "help" ] && help


## functions ## functions
function md5_in_add() { function md5_in_add() {
exit 0 exit 0
} }


function md5_rm() { function md5_rm() {
exit 0 exit 0
} }


function md5_in_del() { function md5_in_del() {
exit 0 exit 0
} }


function md5_out_exist() { function md5_out_exist() {
exit 0 exit 0
} }


function md5_out_del() { function md5_out_del() {
exit 0 exit 0
} }


# help functions # help functions
@ -90,14 +90,14 @@ function db_query() {


# db_exist_md5 <md5> -> true/false 0/1 # db_exist_md5 <md5> -> true/false 0/1
function db_exist_md5() { function db_exist_md5() {
result=($(db_query "SELECT COUNT(md5) FROM File WHERE File.MD5 LIKE '$1';")) result=($(db_query "SELECT COUNT(md5) FROM File WHERE File.MD5 LIKE '$1';"))
if [ "${result[2]}" -gt "0" ]; then if [ "${result[2]}" -gt "0" ]; then
echo true echo true
return 0 return 0
else else
echo false echo false
return 1 return 1
fi fi
} }


case "$mode" in case "$mode" in
@ -118,7 +118,7 @@ case "$mode" in
;; ;;
*) *)
echo "wrong arguments" echo "wrong arguments"
echo "" echo ""
help help
;; ;;
esac esac