16 lines
373 B
Plaintext
16 lines
373 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
url="https://bin.xstefen.dev"
|
||
|
filepath="$1"
|
||
|
filename=$(basename -- "$filepath")
|
||
|
extension="${filename##*.}"
|
||
|
|
||
|
response=$(curl --data-binary @${filepath:-/dev/stdin} --url $url)
|
||
|
|
||
|
#echo "$url$response"".""$extension" | tee >(xclip -selection clipboard)
|
||
|
|
||
|
pastelink="$url$response"
|
||
|
[ -z "$extension" ] && \
|
||
|
echo "$pastelink" || \
|
||
|
echo "$pastelink.$extension"
|