From be6ac6673a787d43713ff5db6907ace7c7d89588 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 11 May 2019 02:34:52 +0200 Subject: [PATCH] add db check --- tools/db/update-file-state | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/db/update-file-state b/tools/db/update-file-state index 1c1dbc0..0ee8313 100644 --- a/tools/db/update-file-state +++ b/tools/db/update-file-state @@ -58,6 +58,9 @@ function main() { #cd to moviedir cd "$moviedir" + #db checks + [ "$(db_check)" == $FALSE ] && exit 1 + #clean DB from old stuff { db_query "DELETE From File WHERE Size=0 OR MD5="" OR MD5 IS NULL;" @@ -178,6 +181,12 @@ function db_query() { echo $@ | mysql $args } +function db_check() { + echo DUMMY FUNC db_check + echo aim: check DB conection + shema + echo $TRUE +} + # db_F-ID_getPath -> function db_id_getPath() { db_query "SELECT CONCAT('$moviedir/', Folder, '/', Name) FROM File WHERE ID=$1;"