Hi and sorry my english.
If you want WoL more computers from net:
1) Add a (more) computer's mac to "Manually Assigned IP List" and "Enable Manual Assignment"
2) Create some script in webserver's cgi-bin folder:
.../cgi-bin/wakeuplist.cgi
Code:
#!/bin/sh
cat << __FLUSH
Content-type: text/html
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<title>WebStatus</title>
</head>
<body bgcolor=#5555aa link=#000000 vlink=000000>
<h2>System info for Asus home gateway router</h2>
<hr>
__FLUSH
echo "<form method=\"post\" action=\"/cgi-bin/wakeup.cgi\">"
awk -f wol.awk /etc/ethers "ethlist" >ethlist.$$
cat ethlist.$$
echo "<br><br><input type=\"submit\" value=\"Wake Up\">"
echo "</form>"
rm ethlist.$$
cat << __FLUSH
<hr>
</body>
</html>
__FLUSH
../cgi-bin/wakeup.cgi
Code:
#!/bin/sh
cat >> ethselect.$$
cat << __FLUSH
Content-type: text/html
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<title>WebStatus</title>
</head>
<body bgcolor=#5555aa link=#000000 vlink=000000>
<h2>System info for Asus home gateway router</h2>
<hr><a align=center href=/cgi-bin/wakeuplist>Back</a><hr>
__FLUSH
ETH=`cat ethselect.$$ | sed -e 's/WOL=//g'`
MAC=`awk -f wol.awk /etc/ethers "ethselect" "$ETH"`
if [ "$MAC" == "" ] ; then
echo "<br>Not select computer's eth device...<br><br>"
else
echo "<br>Send WoL packet to ${MAC} ...<br><br>"
ether-wake -i br0 ${MAC}
fi
rm ethselect.$$
cat << __FLUSH
<hr><a align=center href=/cgi-bin/wakeuplist>Back</a><hr>
</body>
</html>
__FLUSH
../cgi-bin/wol.awk
Code:
# KGy's wol web interface template handler
# Copyright (C) 2007 by KGy
#
# Based on Seaky CTCS Web interface template handler
# Copyright (C) 2006 by Robert Szakalli <seaky77@gmail.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# version 0.99 alpha
BEGIN{
if (ARGC<2) {
print "Template Handler v1.0 by KGy 2007 (c)\n";
exit(0);
}
if (ARGV[2]=="ethlist") {
l=1;
while ((getline rline < ARGV[1]) > 0) {
if (index(rline,"#")!=1) {
print "<tt><br><input name=\"WOL" "\" type=\"radio\" value=\"" l "\"> " rline "</tt>";
l++;
}
}
} else if (ARGV[2]=="ethselect") {
if (ARGC<3) {
print "Template Handler v1.0 by KGy 2007 (c)\n";
exit(0);
}
x=ARGV[3];
l=1;
while ((getline rline < ARGV[1]) > 0) {
if (index(rline,"#")!=1) {
if (l==x) {
print substr(rline,1,index(rline," ")-1);
}
l++;
}
}
} else {
print "Template Handler v1.0 by KGy 2007 (c)\nUnknown function\n";
exit(0);
}
}
These scripts use mac list from /etc/ethers, but working, if change it other ( /opt/etc/wakuplist.conf) and fill mac and computer name data (format: also /etc/ethers: "mac_addr name"). If you change /etc/ethers, don't forget change a lline "awk.../etc/ethers", too.
3) add +x attribute to wakeuplist and wakeup scripts.
Code:
chmod +x wakuplist
chmod +x wakup
To WoL PC, use http://www.yoursite.com/cgi-bin/wakeuplist.cgi url.
George