summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorVG <vg@devys.org>2014-11-29 16:00:24 +0100
committerVG <vg@devys.org>2014-11-29 16:00:24 +0100
commit4475362294e6c8fd0df4f19c035bed81e595671c (patch)
treef4d1b9ed501813b0b4cb269e20978c7de8c6b171 /scripts
parentfa99456c1d55256602c69b0bf4f4e4bcaca43b82 (diff)
downloadpasteme-4475362294e6c8fd0df4f19c035bed81e595671c.tar.gz
pasteme-4475362294e6c8fd0df4f19c035bed81e595671c.tar.bz2
pasteme-4475362294e6c8fd0df4f19c035bed81e595671c.zip
fix pasteme script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/pasteme14
1 files changed, 3 insertions, 11 deletions
diff --git a/scripts/pasteme b/scripts/pasteme
index a47fdc6..db4b641 100755
--- a/scripts/pasteme
+++ b/scripts/pasteme
@@ -1,18 +1,10 @@
#!/bin/bash
file="$1"
-tempfile=""
-
-rmtempfile_cb() { rm "$tempfile"; }
if [ "$file" == "" ]; then
- tempfile="$(mktemp)"
- trap rmtempfile_cb EXIT
- cat > $tempfile
- file=$tempfile
+ file=-
fi
-file="${file/\\/\\\\}"
-file="${file/\"/\\\"}"
-
-curl --form "content=<\"$file\"" http://paste.devys.org/
+cat "$file" \
+ | curl -w '%{redirect_url}\n' --form 'content=<-' http://paste.devys.org/