#!/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 $QUERY_STRING 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 EOF while read line do set $line host=$5 ip=$4 iface=$3 mac=$2 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\"" # if [ "$state" = "offline" ] # then echo "\"$_WOL_execute\"" # else # echo " " # fi echo "" done < /var/run/wol/hosts.mac echo "
$_WOL_note" show_tab_footer ;; *) show_html_header "Wake On LAN" "refresh=$_rshort;url=$_rurl" /usr/local/bin/wol.sh $QUERY_STRING show_info "$_WOL_done_info$QUERY_STRING" "$_WOL_done_message$_WOL_done_url." ;; esac show_html_footer