summaryrefslogtreecommitdiff
path: root/.local/bin/up
blob: 9ef9ae01287845f3da642f755afa374bd65eff80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e

upload()
{
	local f="$1"
	[ $1 = '-' ] && f=/dev/stdin
	curl --retry-all-errors -X POST -H "Authorization: $TOKEN" -F "data=@$f" \
		https://paste.thomasvoss.com
}

readonly TOKEN=`vlt raw Miscellaneous 'Mpaste (Key)'`

[ $# -eq 0 ] && upload -
for f in "$@"
do
	upload "$f" &
done

wait