Advertisement
MeikoDis

puush

Jun 26th, 2013
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. EMAIL=
  3. APIKEY=
  4. ENDPOINT=http://puush.me
  5.  
  6.  
  7. count=1
  8.  
  9. if [ $# -eq 1 ]; then
  10.   link=`curl -s -F "z=poni" -F "e=$EMAIL" -F "k=$APIKEY" -F "f=@$1" $ENDPOINT/api/up/ | cut -d',' -f 2`
  11.   while [ -z "$link" ]
  12.   do
  13.     echo -e "Error. \nTry: $count. \nPress CTRL + C to stop trying."
  14.     link=`curl -s -F "z=poni" -F "e=$EMAIL" -F "k=$APIKEY" -F "f=@$1" $ENDPOINT/api/up/ | cut -d',' -f 2`
  15.     (( count+=1 ))
  16.   done
  17.  
  18.   echo $link
  19. else
  20.   echo "Usage: puu.sh <file>"
  21. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement