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;"