From 7bea4fdb1cd207bd1d72cd39db0d5342ad8c6e5c Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Thu, 25 Mar 2010 02:20:49 +0000 Subject: [PATCH] convert to email format --- index.cgi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.cgi b/index.cgi index f8b0683..c6aed7c 100755 --- a/index.cgi +++ b/index.cgi @@ -47,7 +47,7 @@ function do_print { input="$1" elif [ -f "db/$1" ]; then input="db/$1" - trim='1d' # sed command to remove cruft + trim='1,/^$/d' # sed command to remove cruft else echo "Status: 404 Not Found" header text/plain @@ -99,7 +99,11 @@ function do_upload { fi output="$(mktemp db/XXXXX)" uri="$url$(basename "$output")${QUERY_STRING:+"?"}" - (get_modeline; echo "$text") > "$output" + (get_modeline + echo "Date: $(date -R)" + echo "From: $REMOTE_ADDR" + echo + echo "$text") > "$output" echo "Status: 302 Found" echo "Location: $uri" header text/plain -- 2.43.2