shutdown.sh
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Copyright (c) 2001-2019 kingtroldata, Ltd.
# All rights reserved.
#
# author: liyuanyuan (mailto:yuanyuan.li@kingtroldata.com)
#
## resolve links
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
SKRECEIVE_COMPONENT_HOME=`dirname "$PRG"`/..
# make it fully qualified
SKRECEIVE_COMPONENT_HOME=`cd "$SKRECEIVE_COMPONENT_HOME" && pwd`
cd "$saveddir"
SERVICE_NAME=skreceive
export MODE=service
export PID_FOLDER="${SKRECEIVE_COMPONENT_HOME}"/logs
export LOG_FOLDER="${SKRECEIVE_COMPONENT_HOME}"/logs
export identity=${SERVICE_NAME}
# export CONF_FOLDER="${SKRECEIVE_COMPONENT_HOME}"/conf
# If exists private jdk
if [ -d "${SKRECEIVE_COMPONENT_HOME}/jdk" ] || [ -h "${SKRECEIVE_COMPONENT_HOME}/jdk" ] || [ -L "${SKRECEIVE_COMPONENT_HOME}/jdk" ]; then
export JAVA_HOME="${SKRECEIVE_COMPONENT_HOME}/jdk"
fi
RECEIVE_JAR=`echo "${SKRECEIVE_COMPONENT_HOME}"/*.jar`
if [ ! -x "${RECEIVE_JAR}" ]; then
chmod + "${RECEIVE_JAR}"
fi
$RECEIVE_JAR stop "$@"