diff options
-rwxr-xr-x | .local/bin/up | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.local/bin/up b/.local/bin/up new file mode 100755 index 0000000..9ef9ae0 --- /dev/null +++ b/.local/bin/up @@ -0,0 +1,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 |