diff options
Diffstat (limited to 'xup.sh')
-rwxr-xr-x | xup.sh | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -1,8 +1,8 @@ #!/bin/sh #----------------------------------------------------# # File: xup.sh -# Version: 0.1.1 -# Date: 2008-12-14 +# Version: 0.1.3 +# Date: 2009-01-12 # Author: Florian "Bluewind" Pritz <f-p@gmx.at> # Upload file to XUP, copy URL to clipboard and # save to historyfile @@ -21,17 +21,19 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. XUPHIST="${HOME}/.xup_history" -FILE=$(basename $1) -DIR=$(dirname $1) -cd $DIR +FILE="$(basename "$1")" +DIR="$(dirname "$1")" +cd "$DIR" URLS=$(curl -# -F "F1=@$FILE" -L "http://www.xup.in/xtrans.php" -H "Expect: ") -DL_URL=$(echo -n ${URLS} | ack -o "\"http://www.xup.in/dl,.{8}/$FILE/\"" | sed "s#\"##g") -DEL_URL=$(echo -n ${URLS} | ack -o "\"http://www.xup.in/kill,.{8},.{10}/\"" | sed "s#\"##g") +DL_URL=$(echo -n ${URLS} | egrep -o "\"http://www.xup.in/dl,.{8}/$FILE/\"" | sed "s#\"##g") +DEL_URL=$(echo -n ${URLS} | egrep -o "\"http://www.xup.in/kill,.{8},.{10}/\"" | sed "s#\"##g") -echo $(date) >> $XUPHIST -echo "$PWD/$FILE" >> $XUPHIST -echo $DL_URL >> $XUPHIST +echo $(date) >> "$XUPHIST" +echo "$PWD/$FILE" >> "$XUPHIST" +echo $DL_URL >> "$XUPHIST" echo -n $DL_URL | xclip -echo $DEL_URL >> $XUPHIST -echo "" >> $XUPHIST +echo -n $DL_URL +echo $DEL_URL >> "$XUPHIST" +echo "" >> "$XUPHIST" +sleep 2 |