Created
June 7, 2015 20:12
-
-
Save NanoAi/dda335db840f56e86407 to your computer and use it in GitHub Desktop.
Script for screencapture and auto send to server, on Mac OSX Yosemite.
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
SITE="http://i.mirai.red"; | |
DIR=~/Screenshots/; | |
[email protected]; | |
FLDR=/home/i.mirai.red; | |
NM=$(LC_CTYPE=C tr -dc "a-zA-Z0-9" < /dev/urandom | head -c 5).png; | |
FILE=$(screencapture -i $DIR$NM && echo $DIR$(ls -Art $DIR | tail -n 1)); | |
if [ -a $FILE ] ; then | |
$(scp $FILE $SSH:$FLDR/$NM && ssh $SSH 'chown mirai-img $FLDR/$NM' && echo $SITE/$NM | pbcopy) && osascript -e 'display notification "Image Uploaded" with title "'"$SITE/$NM"'"' && rm -f $FILE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment