#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
cgi_width=560
. /usr/lib/libmodcgi.sh
cgi_begin 'Wake on LAN'
cat << EOF
$(lang de:"Bekannte Hosts" en:"Known hosts"):
$(lang de:"(wählen)" en:"(choose)")
EOF
if [ -r /tmp/flash/exhosts ]; then
egrep -v '^(#|[[:space:]]*$)' /tmp/flash/exhosts |
while read -r ip mac interface host desc; do
if [ dhcp-host = "$mac" ]; then
if [ -n "$host" -a -r /var/tmp/multid.leases ]; then
mac=`sed "/${host}/!d;s/^lease //;s/ .*//" /var/tmp/multid.leases`
else
continue
fi
fi
if [ -n "$mac" -a "$mac" != "*" ]; then
if [ -n "$interface" -a "$interface" != "*" ]; then
value="$mac*$interface"
else
value="$mac*"
fi
echo -n ''
if [ -n "$desc" ]; then
[ '*' != "$host" ] && echo -n "$host "
echo -n "$desc"
elif [ -n "$host" -a "$host" != "*" ]; then
echo -n "$host"
else
echo -n "$mac"
fi
echo ' '
fi
done
fi
cat << EOF
$(lang de:"MAC und Netzwerk-Schnittstelle für Etherwake angeben oder einen der bekannten Hosts wählen." en:"Fill in a MAC address and a network interface for etherwake or select a known host from the drop down list above.")
EOF
cgi_end