3 BRMSGW_BASE=${POLICY_HOME}/servers/brmsgw/
5 brmsgw_RUNNING="pgrep -f "${BRMSGW_BASE}""
9 function update_monitor() {
12 if [[ -f ${POLICY_HOME}/etc/monitor/monitor.cfg ]]; then
14 -e "s/^${COMPONENT}=.*/${COMPONENT}=${STATUS}/g" \
15 ${POLICY_HOME}/etc/monitor/monitor.cfg
19 # unmonitored stop, does not change monitor status (immutable)
21 pid=$(pgrep -f "${BRMSGW_BASE}" 2> /dev/null)
28 if [[ ${RETVAL} != 0 ]]; then
29 update_monitor ${COMPONENT} on
31 update_monitor ${COMPONENT} off
35 # unmonitored start, does not change monitor status (immutable)
37 unset JMX_JAVA_OPTS JVM_SECURITY
38 JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote")
39 JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.port=$BRMSGW_JMX_PORT")
40 JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.ssl=false")
41 JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.authenticate=false")
42 JVM_JAVA_OPTS=("-Xms${COMPONENT_X_MS_MB}M" "-Xmx${COMPONENT_X_MX_MB}M")
43 JVM_SECURITY+=("-Djavax.net.ssl.keyStore=${POLICY_HOME}/etc/ssl/policy-keystore")
44 JVM_SECURITY+=("-Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWD}")
45 JVM_SECURITY+=("-Djavax.net.ssl.trustStore=${POLICY_HOME}/etc/ssl/policy-keystore")
46 JVM_SECURITY+=("-Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWD}")
48 JAVA_OPTS=("${JVM_JAVA_OPTS[@]}" "${JMX_JAVA_OPTS[@]}" "${JVM_SECURITY[@]}")
50 cd $POLICY_HOME/servers/brmsgw
51 nohup $JAVA_HOME/bin/java -jar "${JAVA_OPTS[@]}" $POLICY_HOME/servers/brmsgw/BRMSGateway.jar>> $POLICY_LOGS/policy/brmsgw/brmsgw.log 2>&1 &
57 if [[ ${RETVAL} != 0 ]]; then
58 update_monitor ${COMPONENT} off
60 update_monitor ${COMPONENT} on
66 pid=$(pgrep -f "${BRMSGW_BASE}" 2> /dev/null)
69 # If the PID was returned means the application is running
70 if [ ${RETVAL} -eq 0 ]; then
71 echo "running with pid ${pid}"
80 COMPONENT=$(basename $0)
82 CONF_FILE="${POLICY_HOME}/servers/${COMPONENT}/config.properties"
87 configfile="dos_or_unix" # set the actual path name of your (DOS or Unix) config file
88 while IFS='= ' read lhs rhs
90 if [[ ! $lhs =~ ^\ *# && -n $lhs ]]; then
91 rhs="${rhs%%\#*}" # Del in line right comments
92 rhs="${rhs%%*( )}" # Del trailing spaces
93 rhs="${rhs%\"*}" # Del opening string quotes
94 rhs="${rhs#\"*}" # Del closing string quotes
95 if [[ $lhs != *"."* ]]; then
102 if [ $? -ne 0 ]; then
103 echo "error: cannot source configuration ${CONF_FILE}"
129 echo "error: invalid option $@"