client: write a simple client for the pastebin
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
cb8e210acb
commit
04c992e8b3
4 changed files with 19 additions and 7 deletions
10
client
Executable file
10
client
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue