From 323816ffd1e4d78ba5ac596de5f6c36b48c31434 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 12 Jan 2009 19:45:48 +0100 Subject: forgot to commit for some time... :( --- xup.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'xup.sh') diff --git a/xup.sh b/xup.sh index bacd7a2..5a271eb 100755 --- a/xup.sh +++ b/xup.sh @@ -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 # Upload file to XUP, copy URL to clipboard and # save to historyfile @@ -21,17 +21,19 @@ # along with this program. If not, see . 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 -- cgit v1.2.3-24-g4f1b