#!/bin/bash

# linux rpxc
# */1 * * * * /home/rpxc/check-runner-rpxc.sh
# wget -c "http://119.96.169.117:3000/kpl-release/release/rpxc-linux-amd64.latest.tar.gz" -O rpxc.tar.gz && rm -rf rpxc-linux-amd64.latest && tar -xvzf rpxc.tar.gz -C ./ && mv rpxc-linux-amd64.latest rpxc && chmod +x rpxc
shpath=$(cd $(dirname $0);pwd)
cd $shpath

appname=rpxc
cmdaddr=:7204

search_pid=`ps -ef|grep -v 'grep'|grep -v 'sh' |grep -c $appname`

echo "$appname: $search_pid"

if [ $search_pid -eq 0 ]
then
  $shpath/$appname -cmd-addr=$cmdaddr -proxysvr=rpx2.kplgnss.com:15102 -apptype=WUD-RPXC -uuidfile=./rpxc.uuid &
fi