From 0adb3ef91a8384cc66fc21052d0370581c3b1b0f Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 28 Oct 2023 14:50:29 +0200 Subject: up: Add the up script --- .local/bin/up | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 .local/bin/up (limited to '.local') 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 -- cgit v1.2.3