Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cat > /dev/stderr << WELCOME
- RGHost uploader by AITap, 2009
- Published under GPLv3 or later
- WELCOME
- if [ "$1" ]; then file="$1"
- else
- cat > /dev/stderr << MAN
- Usage: $0 /path/to/file
- Upload specified file to the http://rghost.ru/ site.
- MAN
- exit 1
- fi
- echo -n "Getting authentification token..." > /dev/stderr
- 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`
- [ $? -eq "0" ] && echo "OK" > /dev/stderr
- echo -n "Uploading file..." > /dev/stderr
- curl -# \
- -b ~/.rghost.cookies \
- -F authenticity_token="$auth" \
- -F file="@${file}" \
- http://phonon.rghost.ru/files | grep -R 'http://rghost.ru/[0-9]*' -o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement