#!/usr/bin/env bash
#
# Update execution process
#    Get data from DB and update DB after update
#

# ----- Constant definition -----
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# -- command path --
PS="/bin/ps"
GREP="/bin/grep"


# -- variable --
TARGET_PRG="cee_updater"
UPD_PRG="/usr/local/nercee/cee_updater"


# ----- Function -----
# no function

# ----- Main -----

ps_ret=`${PS} awux | ${GREP} ${UPD_PRG} | ${GREP} -v grep`

if [ "x${ps_ret}" = "x" ]; then
  # execute sowtware update program
  ${UPD_PRG}
fi

# ----- End Main -----

