Advertisement
Guest User

Untitled

a guest
Mar 26th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cat > /dev/stderr << WELCOME
  4. RGHost uploader by AITap, 2009
  5. Published under GPLv3 or later
  6. WELCOME
  7.  
  8. if [ "$1" ]; then file="$1"
  9. else
  10. cat > /dev/stderr << MAN
  11. Usage: $0 /path/to/file
  12. Upload specified file to the http://rghost.ru/ site.
  13. MAN
  14. exit 1
  15. fi
  16.  
  17. echo -n "Getting authentification token..." > /dev/stderr
  18. auth=`curl -# --cookie-jar ~/.rghost.cookies rghost.ru 2>/dev/null | grep 'upload_form' | cut -d '<' -f 4 | cut -d ' ' -f 4 | cut -d '"' -f 2`
  19. [ $? -eq "0" ] && echo "OK" > /dev/stderr
  20.  
  21. echo -n "Uploading file..." > /dev/stderr
  22.  
  23. curl -# \
  24. -b ~/.rghost.cookies \
  25. -F authenticity_token="$auth" \
  26. -F file="@${file}" \
  27. http://phonon.rghost.ru/files | grep -R 'http://rghost.ru/[0-9]*' -o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement