add draft for md5_in_add
This commit is contained in:
parent
4b4b45e2b1
commit
6174c863df
@ -62,6 +62,16 @@ if [ "$mode" == "help" ] && help
|
|||||||
|
|
||||||
## functions
|
## functions
|
||||||
function md5_in_add() {
|
function md5_in_add() {
|
||||||
|
|
||||||
|
cat data_shares_Filme | while read line; do
|
||||||
|
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)
|
||||||
|
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: ";'()"
|
||||||
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user