From 447965a95515cad3ce66c9dbbc18775b27f9a70b Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sat, 10 Oct 2009 02:09:51 +0000 Subject: [PATCH] updates for vpaste.net --- index.cgi | 10 ++++++---- vpaste | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/index.cgi b/index.cgi index c548220..1ede621 100755 --- a/index.cgi +++ b/index.cgi @@ -87,7 +87,7 @@ function do_print { # Upload handler function do_upload { output="$(mktemp db/XXXXX)" - uri="$SCRIPT_URI$(basename "$output")${QUERY_STRING:+"?"}" + uri="$url$(basename "$output")${QUERY_STRING:+"?"}" (get_modeline; cut_file "$1") > "$output" echo "Status: 302 Found" echo "Location: $uri" @@ -101,7 +101,7 @@ filetypes=$( ls /usr/share/vim/vim{72,files}/syntax/ /home/andy/.vim/after/syntax/ | sed -n 's/.vim$//p' | sort | uniq ) -uploads=$(ls -t db | head -n 5 | sed "s!^!$SCRIPT_URI!") +uploads=$(ls -t db | head -n 5 | sed "s!^!$url!") header text/html cat - < vpaste file [option=value,..]
 <command> | vpaste [option=value,..]

-
 <command> | curl -F 'x=<-' $SCRIPT_URI[?option=value,..]
+
 <command> | curl -F 'x=<-' $url[?option=value,..]

:map vp :exec "w !vpaste ft=".&ft<CR>
:vmap vp <ESC>:exec "'<,'>w !vpaste ft=".&ft<CR>
@@ -181,7 +181,9 @@ EOF } # Main -pathinfo="${SCRIPT_URL/*\/}" +url="http://$HTTP_HOST/$SCRIPT_URI" +pathinfo="${REQUEST_URI/*\/}" +pathinfo="${pathinfo/\?*}" if [ "$pathinfo" ]; then do_print "$pathinfo" diff --git a/vpaste b/vpaste index a24d02c..30633e0 100755 --- a/vpaste +++ b/vpaste @@ -1,5 +1,5 @@ #!/bin/bash -uri="http://andy753421.ath.cx/vpaste/" +uri="http://vpaste.net/" if [ -f "$1" ]; then out=$(curl -s -F "x=<$1" "$uri?$2") else -- 2.43.2