aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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/