aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/pasteme
blob: a47fdc68be3c59e010e372d74699b6887b98f17a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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/