Created
May 11, 2017 21:54
-
-
Save mthierry/3d448cf707b363ad54a7a878fcfdb678 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
result=$(curl -sf --data-binary @${1:--} https://hastebin.com/documents) || { | |
echo "ERROR: failed to post document" >&2 | |
exit 1 | |
} | |
key=$(jq -r .key <<< $result) | |
echo "https://hastebin.com/${key}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo apt-get install jq