#!/bin/sh # get main helper functions . /srv/www/include/cgi-helper check_rights "wol" "view" _rshort=5 # short reload (5) _rurl=$myname # reload-url case $FORM_wolhost in "") show_html_header "Wake On LAN" "cssfile=status" show_tab_header "$_WOL_tab_header" no cat <  $_WOL_tab_host   $_WOL_tab_ip   $_WOL_tab_mac   $_WOL_tab_iface   $_WOL_tab_state   WOL (dst=mac)  WOL (dst=bcast) EOF sed -e "s/\./ /g" /var/run/wol/hosts.mac | sort -k7 -k8n -k2n -k3n -k4n -k5n | while read mac ip1 ip2 ip3 ip4 host iface1 iface2 do ip=$ip1.$ip2.$ip3.$ip4 if [ -z "$iface2" ] then iface=$iface1 else iface=$iface1.$iface2 fi if cat /proc/net/arp | grep "$ip " | grep "0x2 " > /dev/null then state=online else state=offline fi echo " $host  $ip  $mac  $iface " echo "\"$state\"" echo "\"$_WOL_execute\"" echo "\"$_WOL_execute\"" echo "" done echo "
$_WOL_note
 " show_tab_footer ;; *) show_html_header "Wake On LAN" "refresh=$_rshort;url=$_rurl" if [ "$FORM_bcast" = "yes" ] then /usr/local/bin/wol.sh $FORM_wolhost -b show_info "$_WOL_done_info'$FORM_wolhost' (bcast)" "$_WOL_done_message$_WOL_done_url." else /usr/local/bin/wol.sh $FORM_wolhost show_info "$_WOL_done_info'$FORM_wolhost' (mac)" "$_WOL_done_message$_WOL_done_url." fi ;; esac show_html_footer