From 5a8a6f2a18ee7f23ee5fc5739ba56677026b72a5 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 17 Aug 2010 13:22:51 +0200 Subject: update fb Signed-off-by: Florian Pritz --- fb-client/fb-0.6.1 | 80 ------------------------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 fb-client/fb-0.6.1 (limited to 'fb-client/fb-0.6.1') diff --git a/fb-client/fb-0.6.1 b/fb-client/fb-0.6.1 deleted file mode 100644 index 06dd87e..0000000 --- a/fb-client/fb-0.6.1 +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -#---------------------------------------------------- -# Author: Florian "Bluewind" Pritz -# -# Licensed under WTFPL v2 -# (see COPYING for full license text) -# -#---------------------------------------------------- -# only works if useragent contains libcurl -# Dependencies: curl -# Optional: xclip -#---------------------------------------------------- - -VERSION="0.6.1" - -DELETE=0 -EXTENSION="" -GET=0 -PASTEBIN="http://paste.xinu.at" - -do_upload() { - local EXTRA="" - if [[ -n $EXTENSION ]]; then - EXTRA="-F extension=$EXTENSION" - fi - URL="$(curl -# -n -L $EXTRA -F "file=@$1" "$PASTEBIN/file/do_upload")" - echo $URL - echo -n "$URL" | nohup &> /dev/null xclip -} - -read_stdin() { - if tty -s; then - echo "^C to exit, ^D to send" - fi - cat > "$1" -} - -help() { - echo "fb-client version $VERSION" - echo "usage: [cat |] $(basename "$0") [switches] [file(s)|ID(s)]" - echo " Upload/nopaste file/stdin to paste.xinu.at and copy URL to clipboard." - echo " ~/.netrc: machine paste.xinu.at password PASSWORD" - echo "" - echo "Switches:" - echo " -e EXTENSION extension for default highlighting (e.g. \"diff\")" - echo " -d delete the IDs" - echo " -g download the IDs and output on stdout (use with care!)" - echo " -h this help" - exit 0 -} - -while getopts ":e:gdh" OPTION; do - case $OPTION in - e) EXTENSION="$OPTARG";; - g) GET=1;; - d) DELETE=1;; - h) help;; - \?) echo "unknown option \"-$OPTARG\"" >&2; exit 1;; - :) echo "Option \"-$OPTARG\" needs an argument" >&2; exit 1;; - esac -done - -shift $((OPTIND - 1)) - -TMPDIR="$(mktemp -d "/tmp/fb.XXXXXX")" - -if (($# == 0)); then - read_stdin "$TMPDIR/stdin" - do_upload "$TMPDIR/stdin" -else - for i in "$@"; do - if [[ $DELETE == 1 ]]; then - curl -n -L "$PASTEBIN/file/delete/$i" - elif [[ $GET == 1 ]]; then - curl -s -o - "$PASTEBIN/$i" - else - do_upload $i - fi - done -fi -- cgit v1.2.3-24-g4f1b