#!/bin/sh

printf "Content-type: text/html; charset=UTF-8\n"
printf "\n"

printf "<html>\n"
printf "<head>\n"
printf "<title>Bash CGI script</title>\n"
printf '<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.css">\n'
printf '<meta name="viewport" content="width=device-width, initial-scale=1.0" />\n'

printf "</head>"
printf '<body id="top">'
printf "<main>"
printf "<p>Hello, Your IP address is %s</p>" "$REMOTE_ADDR"
printf "<p>the script filename is <pre>%s</pre></p>" "$SCRIPT_FILENAME"
printf "<p>the script name is <pre>%s</pre></p>" "$SCRIPT_NAME"
printf "<pre>"
env
printf "</pre>"
printf "</main>"
printf "</body>"
printf "</html>"

exit 0

