shell 调 java

functionget_jnp_port

{

typesetcfg_file="${HOME}/jboss/server/default/conf/jboss-service.xml"

RETURN[0]=""

if[!-r${cfg_file}];then

return1

fi

RETURN[0]=`awk-F"<"'

BEGIN{

find=0

}

{

if(0==find&&$0~/^[\t]*<mbean[\t]+code=\"org\.jboss\.naming\.NamingService\"/)

{

find=1

}

if(1==find&&$0~/^[\t]*<attribute[\t]+name=\"Port\">[0-9]*<\/attribute>/)

{

printsubstr($2,index($2,">")+1)

exit0

}

}'${cfg_file}`

if[$?-ne0-o"X${RETURN[0]}"="X"-o${RETURN[0]}-eq0];then

return1

else

return0

fi

}

get_jnp_port

typesetjnp_port=${RETURN[0]}

${HOME}/jboss/bin/twiddle.sh-sjnp://localhost:${jnp_port}invokebme.cbprefresh:service=cbprefreshrefresh"${cbp_no},${refreshIp}"

#!/bin/sh

#dsb_local_ip,defaultvalue:127.0.0.1

dsb_local_ip=127.0.0.1

#jnpportofdsbserver,defaultvalue:1099

dsb_jnp_port=11399

cd$HOME/jboss/bin/

twiddle.sh-s${dsb_local_ip}:${dsb_jnp_port}invokejboss.dmatrix:service=importproductprotoImport"${cbp_no},${refreshIp}"

相关推荐