- modular db_query

- empty password wont be asked animore
This commit is contained in:
6543 2019-02-07 22:14:31 +01:00
parent d95a7ea54f
commit ba3ac3b276

View File

@ -38,7 +38,7 @@ function help() {
echo " -ed export md5 of deleted fiels" echo " -ed export md5 of deleted fiels"
echo "" echo ""
echo " moviedir: Is optional if it is already in the global config" echo " moviedir: Is optional if it is already in the global config"

exit 0 exit 0
} }
if [ "$mode" == "help" ] && help if [ "$mode" == "help" ] && help
@ -80,7 +80,12 @@ function md5_out_del() {


# db_query <query> -> result # db_query <query> -> result
function db_query() { 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 <md5> -> true/false 0/1 # db_exist_md5 <md5> -> true/false 0/1
@ -116,4 +121,4 @@ case "$mode" in
echo "" echo ""
help help
;; ;;
esac esac