#!/bin/sh Usage() { echo "" echo "$0 [option ...]" echo " --stop=[osm|txn|uts] Input osm, txn, and uts, separated by commas." echo " If there is no value input, the entire process-" echo " is terminated." echo " (ex. --stop or --stop=txn,uts)" echo "" exit 1 } BASE_DIR=`pwd` if [ -z "${INTERMAX_HOME}" ];then if [ ! -f "${BASE_DIR}/imxctl.sh" ];then echo "Please run it from imxctl.sh file location." exit 2 fi cd .. INTERMAX_HOME=`pwd` fi cd ${INTERMAX_HOME} echo "INTERMAX_HOME[${INTERMAX_HOME}]" if [ -z "$1" ];then Usage fi for i in $@ do echo "${i}" case "$i" in --stop=*) STOP_LIST=`echo "$i" | awk -F'=' '{print $2}'` ;; --stop) STOP_LIST="osm,txn,uts" ;; *) Usage ;; esac done if [ -n "${STOP_LIST}" ];then STOP_LIST=`echo "${STOP_LIST}" | sed 's/,/ /g'` # STOP_LIST=`echo "${STOP_LIST}" | awk -F',' '{print $1" "$2" "$3}'` # µð·ºÅ丮±îÁö¸¸ °Ë»çÇÑ´Ù. if [ ! -d "${INTERMAX_HOME}/data/agent" ];then echo "pid directory is not exist.[${INTERMAX_HOME}/data/agent]" Usage fi # Check imx list for STOP_IMX in ${STOP_LIST} do if [ "${STOP_IMX}" != "osm" ] && [ "${STOP_IMX}" != "txn" ] && [ "${STOP_IMX}" != "uts" ];then echo "imx name is wrong." Usage fi done # Stop imx for STOP_IMX in ${STOP_LIST} do if [ -f "${INTERMAX_HOME}/data/agent/imx${STOP_IMX}" ];then echo "--> imx${STOP_IMX} stop!" # echo "mv ${INTERMAX_HOME}/data/agent/imx${STOP_IMX} ${INTERMAX_HOME}/data/agent/imx${STOP_IMX}.stopped" mv ${INTERMAX_HOME}/data/agent/imx${STOP_IMX} ${INTERMAX_HOME}/data/agent/imx${STOP_IMX}.stopped else echo "--> imx${STOP_IMX} is not running" fi done fi exit 0