#!/bin/sh . /mod/etc/conf/mod.cfg log='' [ "$(/mod/etc/init.d/rc.webcfg status)" = "running" ] || \ log="$(/mod/etc/init.d/rc.webcfg start 2>&1)" # Use HTTP_REFERER to determine target host (could be a name or an IP) TARGET_HOST=$(env | sed -n -r 's/^HTTP_REFERER=[^:]+:\/\/([^/:]+).*/\1/p') location="http://$TARGET_HOST:$MOD_HTTPD_PORT/" cat << EOF Content-type: text/html; charset=iso-8859-1 $([ -n "$log" ] && echo "$log
") Redirecting...dsmod EOF