#!/bin/sh

# Fedora Unity pastebin tool.  Updated 8/2 for latest fpaste code, thanks daMaestro!
# License:  GPL v3 - http://www.gnu.org/copyleft/gpl.html

if [ ! -e /usr/bin/curl ]; then
 echo "Curl is not installed, please yum install curl"
 exit
fi

if [ -e "$1" ] || [ "$1" == "-" ]; then
 echo -n "Please tell us this resulting URL (may take a second):  "
 cat $1 | curl -s -i -F "content=<-;type=text/plain" -F "expire_options=3600" -F "lexer=text" http://fpaste.org/|grep "Location"|awk -F ": " '{print $2}'
else
 echo Usage: $0 filename_to_paste.txt
fi
