#!bin/sh
zone_id_start=$1
zone_id_end=$2

index1=寻宝
index2=服
server_name=
mapserver(){
 server_name=$index1$1$index2
 #echo $server_name
}

server_path=/server/bin
zone_server_config=
server_item_path=/script/Config.lua
zone_index=$zone_id_start
cur_dir_path=
for ((;zone_index<=zone_id_end;zone_index++)) do
   #echo $zone_index
   cur_dir_path=$server_path$zone_index
   #echo $cur_dir_path
   if [ -d $cur_dir_path ]; then
	#echo "Dir exist"
	zone_server_config=$server_path$zone_index$server_item_path
        if [ -f $zone_server_config ]; then
	   #echo "File exist"
           mapserver $zone_index
	   sed -i "32c\SVR_NAME = \"${server_name}\"" ${zone_server_config}
           echo ${zone_server_config}
        else
	   echo "${zone_server_config} is not exist"
	fi
   else
	echo "${cur_dir_path} is not exist"
   fi
 done


