shell 调 java

function get_jnp_port
{
typeset cfg_file="${HOME}/jboss/server/default/conf/jboss-service.xml"

RETURN[0]=""
if [ ! -r ${cfg_file} ]; then
return 1
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>/)
{
print substr($2,index($2,">")+1)
exit 0
}
}' ${cfg_file}`

if [ $? -ne 0 -o "X${RETURN[0]}" = "X" -o ${RETURN[0]} -eq 0 ]; then
return 1
else
return 0
fi
}

get_jnp_port
typeset jnp_port=${RETURN[0]}
${HOME}/jboss/bin/twiddle.sh -s jnp://localhost:${jnp_port} invoke bme.cbprefresh:service=cbprefresh refresh "${cbp_no},${refreshIp}"



#!/bin/sh

#dsb_local_ip, default value: 127.0.0.1
dsb_local_ip=127.0.0.1

#jnp port of dsb server, default value: 1099
dsb_jnp_port=11399

cd $HOME/jboss/bin/
twiddle.sh -s ${dsb_local_ip}:${dsb_jnp_port} invoke jboss.dmatrix:service=importproduct protoImport "${cbp_no},${refreshIp}"

你可能感兴趣的:(java,xml,jboss,F#)