add show2cp
This commit is contained in:
parent
f19af9631e
commit
398ec4f3f6
25
tools/manage_md5-lists/show2cp
Executable file
25
tools/manage_md5-lists/show2cp
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#show2cp [md5 file] (relative path root)
|
||||||
|
|
||||||
|
md5="$1"
|
||||||
|
rootdir=""
|
||||||
|
[ -n "$2" ] && rootdir="$2/"
|
||||||
|
[ -z "$md5" ] && md5=2cp.md5
|
||||||
|
[ -f "$md5" ] || { echo "ERROR: $md5 not found"; exit 255; }
|
||||||
|
|
||||||
|
function calc_kb() {
|
||||||
|
i=0
|
||||||
|
cat "$1" | cut -c 34- | while read line; do
|
||||||
|
kb=$(du "${rootdir}${line}" | cut -f 1)
|
||||||
|
i=$((i+kb))
|
||||||
|
echo $i
|
||||||
|
done | tail -n1
|
||||||
|
}
|
||||||
|
|
||||||
|
kb=$(calc_kb "$md5")
|
||||||
|
mb=$((kb/1024))
|
||||||
|
gb=$((mb/1024))
|
||||||
|
tb=$((gb/1024))
|
||||||
|
|
||||||
|
echo "Noch Zu Kopieren: $kb Kb = $mb Mb = $gb Gb = $tb Tb"
|
Loading…
Reference in New Issue
Block a user