Last active
November 7, 2018 18:14
-
-
Save noook/a3c96e3e8fd2d968f2b712cff86fd0f9 to your computer and use it in GitHub Desktop.
Uploads a screenshot to the server and copies the link in the clipboard
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
| generate_uid() { | |
| NEWUID=$(openssl rand -base64 15 | sed -E 's/[\/\+=]//' | head -c 6); | |
| CODE=$(curl -sI https://domain.tld/$NEWUID.png | head -n 1|cut -d$' ' -f2); | |
| if [ $CODE == 200 ];then | |
| echo $(generate_uid); | |
| else | |
| echo $NEWUID; | |
| fi | |
| } | |
| ID=$(generate_uid); | |
| echo "https://domain.tld/$ID.png" | pbcopy & | |
| screencapture -o -i /tmp/$ID.png; | |
| scp -q /tmp/$ID.png [email protected]:/path/to/folder; | |
| rm /tmp/$ID.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment