Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. PUUSH_API_KEY="YOUR API KEY HEX CODE"
  4. FILE="/tmp/puush.jpg"
  5.  
  6. if [ -z "$PUUSH_API_KEY" ]; then
  7.   echo "Set the variable PUUSH_API_KEY"
  8.   exit 1
  9. elif [ -z "$1" ]; then
  10.   echo "Specify a mode (-a or -s) or file"
  11.   exit 2
  12. fi
  13. if [ -f $FILE ]; then
  14.         rm $FILE
  15. fi
  16. case "$1" in
  17.         -a)
  18.                 scrot $FILE
  19.                 ;;
  20.  
  21.         -s)
  22.                 scrot -s $FILE
  23.                 ;;
  24.         *)
  25.                 FILE=$1
  26.                 ;;
  27. esac
  28.  
  29. curl "https://puush.me/api/up" -# -F "k=$PUUSH_API_KEY" -F "z=poop" -F "f=@$FILE" | sed -E 's/^.+,(.+),.+,.+$/\1/' | xclip
  30. mpg123 ~/media/sonidos/robot_servo_arm.mp3 > /dev/null 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement