#!/bin/sh

. /mod/etc/conf/mod.cfg
. /mod/etc/conf/wol.cfg

if [ "$(/mod/etc/init.d/rc.wol status)" = "running" ] ; then 
	location="http://$HTTP_HOST:$WOL_PORT/"
else
	location="http://$HTTP_HOST:$MOD_HTTPD_PORT/cgi-bin/pkgconf.cgi?pkg=wol"
fi

cat << EOF
Content-type: text/html; charset=iso-8859-1

<html>
<head>
<meta http-equiv="refresh" content="0;url=$location">
</head>
<body style="margin: 0px: pading: 0px; color: #b0b0b0; font-size: 10px;">
Redirecting...<a style="color: #b0b0b0;" href="$location">dsmod wol</a>
</body>
</html>
EOF