diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-09-11 17:49:27 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-09-11 17:49:27 +0200 |
commit | e76f369583c059c5ba1d68464886d9b33ed8a78e (patch) | |
tree | c9976832f130961415dfde46dac4bfe0e8394305 /fb.in | |
parent | 1c3d1e15e3c1dfd4086f077d2ed405acd94c8b5a (diff) |
fetch history from server
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r-- | fb.in | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -22,7 +22,6 @@ TAREXT=".tar" TAROPTS="" DISPLAYHISTORY= PASTEBIN="http://paste.xinu.at" -FBHIST="$HOME/.fb-client.hist" WARNSIZE=10485760 USERAGENT="fb-client/$VERSION" CLIPBOARD="" @@ -94,8 +93,6 @@ do_upload() { echo $URL if echo $URL | grep -qE "^https?://"; then CLIPBOARD="$CLIPBOARD $URL" - touch "$FBHIST" - echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST" fi } @@ -174,9 +171,7 @@ if [ "$DELETE" ] || [ "$GET" ]; then for i in "$@"; do i=$(id_from_arg "$i") if [ "$DELETE" ]; then - if $LIBDIR/fb-helper d "$PASTEBIN/file/delete/$i"; then - sed -i "/$i/d" $FBHIST - else + if ! $LIBDIR/fb-helper d "$PASTEBIN/file/delete/$i"; then EXITCODE=1 fi @@ -193,15 +188,7 @@ if [ "$DELETE" ] || [ "$GET" ]; then fi done elif [ "$DISPLAYHISTORY" ]; then - maxage=`echo 10*24*60*60 | bc` - minsize=`echo 10*1024| bc` - - now=`date +%s` - oldest_time=`echo "$now - $maxage" | bc` - - awk -F" :: " ' - ($4 < '$minsize' || $3 < '$oldest_time' ) { print $1" - \""$2"\" on "strftime("%a %b %d %H:%M:%S %Z %Y", $3)} - ' $FBHIST + $LIBDIR/fb-helper d "$PASTEBIN/file/upload_history" || EXITCODE=1 elif [ $# -eq 0 ]; then if [ "$TAR" ]; then |