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
#!/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`
FMBOOT_COMPONENT_HOME=`dirname "$PRG"`/..
# make it fully qualified
FMBOOT_COMPONENT_HOME=`cd "$FMBOOT_COMPONENT_HOME" && pwd`
cd "$saveddir"
SERVICE_NAME=fmboot
export MODE=service
export PID_FOLDER="${FMBOOT_COMPONENT_HOME}"/logs
export LOG_FOLDER="${FMBOOT_COMPONENT_HOME}"/logs
export identity=${SERVICE_NAME}
# export CONF_FOLDER="${FMBOOT_COMPONENT_HOME}"/conf
# If exists private jdk
if [ -d "${FMBOOT_COMPONENT_HOME}/jdk" ] || [ -h "${FMBOOT_COMPONENT_HOME}/jdk" ] || [ -L "${FMBOOT_COMPONENT_HOME}/jdk" ]; then
export JAVA_HOME="${FMBOOT_COMPONENT_HOME}/jdk"
fi
BOOT_JAR=`echo "${FMBOOT_COMPONENT_HOME}"/*.jar`
if [ ! -x "${BOOT_JAR}" ]; then
chmod + "${BOOT_JAR}"
fi
$BOOT_JAR stop "$@"