diff options
author | VG <vg@devys.org> | 2014-11-29 16:00:24 +0100 |
---|---|---|
committer | VG <vg@devys.org> | 2014-11-29 16:00:24 +0100 |
commit | 4475362294e6c8fd0df4f19c035bed81e595671c (patch) | |
tree | f4d1b9ed501813b0b4cb269e20978c7de8c6b171 /scripts | |
parent | fa99456c1d55256602c69b0bf4f4e4bcaca43b82 (diff) | |
download | pasteme-4475362294e6c8fd0df4f19c035bed81e595671c.tar.gz pasteme-4475362294e6c8fd0df4f19c035bed81e595671c.tar.bz2 pasteme-4475362294e6c8fd0df4f19c035bed81e595671c.zip |
fix pasteme script
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/pasteme | 14 |
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/ |