#!/bin/sh  
#Function:server list
#Writer:liutiansi
#Mail:lliutiansi@gmail.com
#Date:2007-10-27 16:25

source config
source checkonline
list_server_tempfile=`list_server_tempfile 2>/dev/null` || list_server_tempfile=/tmp/OPreturn$main_pid

mysql_result=`$mysql_bin -h $mysql_host -u$mysql_user -p$mysql_passwd -e "select SERVER,SERVERIP,SERVERNAME,TOLOG,TOLD,TOFIREWALL,TOPERAGENT,TOSQUIDAGENT,TORESINAGENT,TOAPACHEAGENT,TOBINDAGENT from sysadmin.ty_server where SERVERCLASS='$server_class_value'$sqltj;" | awk 'NR>1 {print NR,$0}'|awk '{print $2" │　"$3"　│　["$5"]　│　["$6"]　│　["$7"]　│　["$8"]　│　["$9"]　│　["$10"]　│　["$11"]　│　["$12"]　│ "$4}'`
mysql_result1=`$mysql_bin -h $mysql_host -u$mysql_user -p$mysql_passwd -e "select CLASSNAME from sysadmin.ty_server_class where ID='$server_class_value';" | awk 'NR>1 {print NR,$0}'|awk '{print $2}'`
if [ -z "$mysql_result" ]; then
	mysql_result="空　　 空　　 空"
fi
dialog --clear --colors --item-help --backtitle "$copyright_info" --title "$system_info" \
--menu "\n当前类别：【$mysql_result1】\n\n　　　　　LAN　　│　　　　WAN　　　│　LOG　│　SSH　│Firewall│PerfoAG│SquidAG│ResinAG│ApacheAG│BindAG" 29 120 18 \
$mysql_result \
2> /dev/null
echo "1" > $list_server_tempfile
