#!/bin/bash

dir=$(cd `dirname $0`; pwd)

jar=${dir}/ContactServer.jar
conf=${dir}/tars.conf

cmd="java -jar -Dconfig="${conf}" "${jar}

num=$(ps aux | grep "${cmd}" | grep -v grep | wc -l)

if [ ${num} -gt 0 ]; then
        ps aux | grep "${cmd}" | grep -v grep | awk '{print $2}' | xargs kill -9
fi

nohup java -jar -Dconfig=${conf} ${jar}&


