From c68841959edc4814454a77def8a17ab85a208c71 Mon Sep 17 00:00:00 2001 From: 6543 Date: Thu, 7 Feb 2019 22:58:52 +0100 Subject: [PATCH] first working md5_in_add (with special sign bug) --- tools/db/import-md5-list | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/db/import-md5-list b/tools/db/import-md5-list index bfe05e3..d59a9d4 100644 --- a/tools/db/import-md5-list +++ b/tools/db/import-md5-list @@ -65,11 +65,10 @@ if [ "$mode" == "help" ] && help ## functions function md5_in_add() { - - cat data_shares_Filme | while read line; do + cat $md5 | while read line; do #for each line in md5 md5=$(echo $line | cut -c -32) path=$(echo $line | cut -c 33- | sed 's/^\ //g') - relrevpath=$(echo $path | sed "s|$moviedir||g" | sed 's|^/||g' | sed 's|/$||g' | rev) + relrevpath=$(echo $path | sed "s|^$moviedir||g" | sed 's|^/||g' | sed 's|/$||g' | rev) name=$(echo $relrevpath | cut -d '/' -f 1 | rev) folder=$(echo $relrevpath | cut -d '/' -f 2- | rev) db_query "INSERT INTO File (MD5, Folder, Name) VALUES ('$md5', '$folder', '$name' );" #-> handle in future: ";'()"