#!/usr/bin/webif-page /dev/null 2>&1)& WOLStatus="@TR<>." fi c=$((c+1)) done [ "$WOLStatus" != "" ] && FORM_wolmac="" || { validate <>|required|$FORM_wolmac ip|FORM_wolip|@TR<>|required|$FORM_wolip EOF if [ $? = 0 ]; then (/usr/bin/wol -h $FORM_wolip $FORM_wolmac 1>/dev/null 2>&1)& WOLStatus="@TR<> $FORM_wolmac." fi } else if empty $FORM_wolip; then FORM_wolip=$(ifconfig eth0 | grep Bcast | awk -F":" '{print $3}' | awk '{print $1}') fi fi else c=0 save=1 if [ "$FORM_newentry" != "" -o "$FORM_newentry2" != "" ];then validate <>|required|$FORM_newentry ip|FORM_newentry2|@TR<>|required|$FORM_newentry2 EOF if [ $? = 0 ];then echo "$FORM_newentry=$FORM_newentry2" >>$textfile FORM_newentry="" FORM_newentry2="" fi fi [ $save = 1 ] && lines=$((lines+1)) fi if empty "$FORM_submit"; then : else SAVED=1 fi header "Static IP/Wake On LAN" display_form <> add_normal_cell|@TR<> end_row EOF c=0; if [ $lines != 0 ];then for string in `cat $textfile`;do c=$((c+1)) mac=`echo $string|cut -d'=' -f1` ip=`echo $string|cut -d'=' -f2` display_form <$mac add_normal_cell|$ip add_normal_cell|@TR<> end_row EOF done fi display_form <>: add_input_cell|newentry|$FORM_newentry|tableTextButton add_input_cell|newentry2|$FORM_newentry2|tableTextButton end_row end_table start_table|0|10|5 add_row add_button_cell|submit|@TR<>|tableTextButton end_row end_table end_div start_div|wol infotable|WOL#Send a Magic Packet to a specific Computer to wake up. start_table|0|10|5 add_row add_label_cell add_normal_cell|@TR<> add_normal_cell|@TR<> end_row add_row add_label_cell|@TR<>: add_input_cell|wolmac|$FORM_wolmac|tableTextButton add_input_cell|wolip|$FORM_wolip|tableTextButton end_row EOF c=0; if [ $lines != 0 ];then for string in `cat $textfile`;do c=$((c+1)) mac=`echo $string|cut -d'=' -f1` ip=`echo $string|cut -d'=' -f2` display_form <$mac add_normal_cell add_checkbox_cell|wol$c||checked end_row EOF done fi display_form <>|tableTextButton end_row end_table end_div EOF if [ WOLStatus != "" ]; then echo "

"$WOLStatus"" WOLStatus="" fi [ "$SAVED" = "1" ] && ( >$ethers SAVED=0 cat $textfile|while read string;do mac=`echo $string|cut -d'=' -f1` ip=`echo $string|cut -d'=' -f2` echo "$mac $ip" >>$ethers done lock -u /var/run/restart-services ) footer ?>