]> Sergey Matveev's repositories - mmc.git/blob - cmd/dl
Quick file download
[mmc.git] / cmd / dl
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 tar tvf $2.tar >&2
13 realpath $2.tar
14 echo -n "x it?"
15 read foo
16 tar xf $2.tar