Skip to content

Instantly share code, notes, and snippets.

@davesherratt
Created April 30, 2013 13:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davesherratt/5488862 to your computer and use it in GitHub Desktop.
Save davesherratt/5488862 to your computer and use it in GitHub Desktop.
Based on Nat Friedman's https://coderwall.com/p/y5eiiq
#!/bin/sh
SCP_USER='user'
SCP_HOST='host'
SCP_PASS='pass'
SCP_PATH='/path/to/file'
HTTP_URL="http://url"
FILENAME=`(cat /dev/random|head -c 10; date) | md5 -q | head -c 10`.png
FILEPATH=/tmp/$FILENAME
screencapture -i $@ $FILEPATH
if [ -f $FILEPATH ]
then
echo $HTTP_URL$FILENAME | pbcopy
sshpass -p ${SCP_PASS} scp $FILEPATH ${SCP_USER}@${SCP_HOST}:$SCP_PATH
rm $FILEPATH
echo `date` $HTTP_URL$FILENAME >> ~/bin/sattap.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment