From ba3ac3b2769ca0bae43783910af36ed9d8208ea6 Mon Sep 17 00:00:00 2001 From: 6543 Date: Thu, 7 Feb 2019 22:14:31 +0100 Subject: [PATCH] - modular db_query - empty password wont be asked animore --- tools/db/import-md5-list | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/db/import-md5-list b/tools/db/import-md5-list index adca8a6..497ae4c 100644 --- a/tools/db/import-md5-list +++ b/tools/db/import-md5-list @@ -38,7 +38,7 @@ function help() { echo " -ed export md5 of deleted fiels" echo "" echo " moviedir: Is optional if it is already in the global config" - + exit 0 } if [ "$mode" == "help" ] && help @@ -80,7 +80,12 @@ function md5_out_del() { # db_query -> result function db_query() { - echo $@ | mysql -h$dbhost -u$dbuser -p$dbpwd $dbname + local args="-sN" #no headers, no grid + args+=" -h$dbhost" + args+=" -u$dbuser" + [ -n "$dbpwd" ] && args+=" -p$dbpwd" + args+=" $dbname" + echo $@ | mysql $args } # db_exist_md5 -> true/false 0/1 @@ -116,4 +121,4 @@ case "$mode" in echo "" help ;; -esac \ No newline at end of file +esac