#!/bin/sh . /mod/etc/conf/mod.cfg . /mod/etc/conf/wol.cfg # 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') if [ "$(/mod/etc/init.d/rc.wol status)" = "running" ] ; then location="http://$TARGET_HOST:$WOL_PORT/" else location="http://$TARGET_HOST:$MOD_HTTPD_PORT/cgi-bin/pkgconf.cgi?pkg=wol" fi cat << EOF Content-type: text/html; charset=iso-8859-1 Redirecting...dsmod wol EOF