Created
April 28, 2018 22:17
-
-
Save mellowagain/017bf7468aec9df99889abf8565f9c4a to your computer and use it in GitHub Desktop.
Automatic uploading of screenshots to your SFTP server. Requires maim and a server that serves the uploaded file like nginx.
This file contains 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/sh | |
filename=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) | |
maim -s /tmp/$filename.png | |
sftp -v -oIdentityFile=path marc@wontfix.club << EOF | |
put /tmp/$filename.png /var/www/wontfix.club/html/i/ | |
EOF | |
echo -n "https://wontfix.club/i/$filename.png" | xclip -sel clip | |
rm -rf /tmp/$filename.png | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment