shutdown.sh 1.1 KB
#!/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`

SKBOOT_COMPONENT_HOME=`dirname "$PRG"`/..

# make it fully qualified
SKBOOT_COMPONENT_HOME=`cd "$SKBOOT_COMPONENT_HOME" && pwd`

cd "$saveddir"


SERVICE_NAME=skboot-wufeng

export MODE=service
export PID_FOLDER="${SKBOOT_COMPONENT_HOME}"/logs
export LOG_FOLDER="${SKBOOT_COMPONENT_HOME}"/logs
export identity=${SERVICE_NAME}
# export CONF_FOLDER="${SKBOOT_COMPONENT_HOME}"/conf

# If exists private jdk
if [ -d "${SKBOOT_COMPONENT_HOME}/jdk" ] || [ -h "${SKBOOT_COMPONENT_HOME}/jdk" ] || [ -L "${SKBOOT_COMPONENT_HOME}/jdk" ]; then
	export JAVA_HOME="${SKBOOT_COMPONENT_HOME}/jdk"
fi

BOOT_JAR=`echo "${SKBOOT_COMPONENT_HOME}"/*.jar`
if [ ! -x "${BOOT_JAR}" ]; then
  chmod + "${BOOT_JAR}"
fi

$BOOT_JAR stop "$@"