aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2014-11-28 18:12:05 +0100
committerVG <vg@devys.org>2014-11-28 18:12:05 +0100
commitcad0e50f61e1e361dcc0e0625d4f19267cd4c7c1 (patch)
tree174e887fad4f11131dc892695a1a12c02861062e
parentf74a985b3f3f05b7b05cef5b9c8be8d748498de5 (diff)
downloadpasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.tar.gz
pasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.tar.bz2
pasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.zip
add a helper script for pasteme
-rwxr-xr-xscripts/pasteme18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/pasteme b/scripts/pasteme
new file mode 100755
index 0000000..a47fdc6
--- /dev/null
+++ b/scripts/pasteme
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+file="$1"
+tempfile=""
+
+rmtempfile_cb() { rm "$tempfile"; }
+
+if [ "$file" == "" ]; then
+ tempfile="$(mktemp)"
+ trap rmtempfile_cb EXIT
+ cat > $tempfile
+ file=$tempfile
+fi
+
+file="${file/\\/\\\\}"
+file="${file/\"/\\\"}"
+
+curl --form "content=<\"$file\"" http://paste.devys.org/