first working md5_in_add (with special sign bug)
This commit is contained in:
parent
53e7bc984a
commit
c68841959e
@ -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: ";'()"
|
||||
|
Loading…
Reference in New Issue
Block a user