#!/bin/sh #------------------------------------------------------------------------------ # /usr/local/htdocs/wolsol/wolsol.cgi - wake/shutdown on LAN # # Copyright (c) 2004-2010 Andreas Pohl, apohl(at)ibp-consult(dot)com # Copyright (c) 2011-2019 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2004-07-30 ap # Last Update: $Id$ # # 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.. #------------------------------------------------------------------------------ #exec 2>/tmp/wolsol-cgi-trace-$$.log #set -x #eval `echo "${QUERY_STRING}" |tr '&' '\n'` query_str="${QUERY_STRING}" myname=`basename $0` sol_env_file=/usr/local/htdocs/wolsol/action-env # HTML header echo "Content-Type: text/html; charset=iso-8859-1" echo "Cache-control: no-store" # HTTP/1.1 (or no-cache?) echo "Pragma: no-cache" # HTTP/1.0 echo echo "
" echo "${name} | "
if [ -n "${ipaddr}" ]
then
/usr/bin/arping -f -c 1 -I ${device} -w 1 -q ${ipaddr}
if [ $? -eq 0 ]
then
echo '![]() ![]() | ' fi echo " " echo " " if [ -f ${sol_cmd_file} ] then echo " " else echo " " fi echo "" echo " |
' echo "" idx=1 while [ ${idx} -le ${WOLSOL_LINK_N} ] do eval l_active='$WOLSOL_LINK_'${idx}'_ACTIVE' if [ "${l_active}" = "yes" ] then eval l_name='$WOLSOL_LINK_'${idx}'_NAME' eval l_href='$WOLSOL_LINK_'${idx}'_HREF' eval l_target='$WOLSOL_LINK_'${idx}'_TARGET' echo " | ${l_name}" fi idx=`expr ${idx} + 1` done echo "
" ./action.sh --html echo "" echo "