# 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"
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 - <<EOF
<pre> vpaste file [option=value,..]</pre>
<pre> <command> | vpaste [option=value,..]</pre>
<br>
- <pre> <command> | curl -F 'x=<-' $SCRIPT_URI[?option=value,..]</pre>
+ <pre> <command> | curl -F 'x=<-' $url[?option=value,..]</pre>
<br>
<pre>:map vp :exec "w !vpaste ft=".&ft<CR></pre>
<pre>:vmap vp <ESC>:exec "'<,'>w !vpaste ft=".&ft<CR></pre>
}
# Main
-pathinfo="${SCRIPT_URL/*\/}"
+url="http://$HTTP_HOST/$SCRIPT_URI"
+pathinfo="${REQUEST_URI/*\/}"
+pathinfo="${pathinfo/\?*}"
if [ "$pathinfo" ]; then
do_print "$pathinfo"
#!/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