All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bin.stop.sh Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`

SERVER_NAME=sharding-jdbc-transaction-async-job

PID=`ps -ef | grep java | grep "$DEPLOY_DIR" |awk '{print $2}'`
if [ -z "$PID" ]; then
    echo "ERROR: The $SERVER_NAME does not started!"
    exit 1
fi

echo -e "Stopping the $SERVER_NAME ...\c"
kill $PID > /dev/null 2>&1

COUNT=0
while [ $COUNT -lt 1 ]; do
    echo -e ".\c"
    sleep 1
    COUNT=1
    PID_EXIST=`ps -f -p $PID | grep java`
    if [ -n "$PID_EXIST" ]; then
        COUNT=0
        break
    fi
done

echo "OK!"
echo "PID: $PID"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy