#!/bin/sh -
#
#   This is a simple "web server" that redirects to another site.
#   It can be used for emergency situations.  You don't need any
#   additional software; it will be started via inetd.
#
#   Save this script as /usr/local/sbin/httpd.sh, "chmod 755" it
#   (so it's executable), and add this line to /etc/inetd.conf:
#
#   http  stream  tcp  nowait  nobody  /usr/local/sbin/httpd.sh  httpd.sh
#
#   Then start inetd.  If it's already running, restart it or
#   send it a SIGHUP signal.  See the inetd(8) manual page).
#
#   On FreeBSD, you can start inetd once by typing as root:
#
#   /etc/rc.d/inetd onestart
#
#   It will run until stopped or shutdown of the machine.
#   If you want to run inetd permanently, i.e. after reboot,
#   Add this line to /etc/rc.conf:
#
#   inetd_enable="YES"
#
#   You might also want to review and override the default
#   inetd_flags, see /etc/defaults/rc.conf and the inetd(8)
#   manpage.
#

REDIRECT="http://www.secnetix.de/"

cat <<-tac
	HTTP/1.0 302 Found
	Date: $(date -u +'%a, %d %b %Y %T GMT')
	Location: $REDIRECT
	Content-Type: text/html

	<HTML><HEAD><TITLE>302 Found</TITLE></HEAD><BODY>
	<H1><A HREF="$REDIRECT">Temporary Redirect to $REDIRECT</A></H1>
	</BODY></HTML>
tac

