]> Sergey Matveev's repositories - mmc.git/blob - cmd/download
b704d2054010fe8b9d564fd162299144b1e9dbb9
[mmc.git] / cmd / download
1 #!/bin/sh -e
2
3 [ $# -eq 2 ] || {
4     echo "Usage: $0 path/to/state fileId" >&2
5     exit 1
6 }
7 tmp=`mktemp`
8 trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
9 echo $2 > "$1"/file/get &
10 cat "$1"/file/out > $tmp
11 mv $tmp $2.tar
12 echo $2.tar
13 tar tvf $2.tar
14 tar xf $2.tar