bin/client
Gunwant Jain 04c992e8b3 client: write a simple client for the pastebin
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 21:23:34 +05:30

11 lines
258 B
Bash
Executable File

#!/bin/sh
url="http://127.0.0.1:8000"
filepath="$1"
filename=$(basename -- "$filepath")
extension="${filename##*.}"
response=$(curl --data-binary @${filepath:-/dev/stdin} --url $url)
echo "$url$response"".""$extension" | tee >(xclip -selection clipboard)