add pst script for internal pastebin
This commit is contained in:
parent
64d50a238b
commit
c0e875a4eb
1 changed files with 15 additions and 0 deletions
15
bin/pst
Executable file
15
bin/pst
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
URL="https://paste.aarn.shelman.io"
|
||||||
|
|
||||||
|
FILEPATH="$1"
|
||||||
|
FILENAME=$(basename -- "$FILEPATH")
|
||||||
|
EXTENSION="${FILENAME##*.}"
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s --data-binary "@${FILEPATH:-/dev/stdin}" --url $URL)
|
||||||
|
PASTELINK="$URL$RESPONSE"
|
||||||
|
|
||||||
|
[ -z "$EXTENSION" ] &&
|
||||||
|
echo "$PASTELINK" ||
|
||||||
|
echo "$PASTELINK.$EXTENSION"
|
Loading…
Reference in a new issue