#!/bin/sh
DIR=$(dirname $0)
cd $DIR
DIRROOT=$(pwd)
function start() {
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>now is starting captain-helper-api.....
export LD_LIBRARY_PATH=$DIRROOT/sdk
nohup java -Dspring.config.location=$DIRROOT/datas/application.properties -jar $DIRROOT/captain-helper-api-1.0.0.jar >/dev/null 2>&1 &
}
function stop() {
echo ">>>>>>>>>>>>>>>>>>>>>>>>>now is stoping captain-helper-api
if [ -f $DIRROOT/captain-helper-api.txt ]; then
FPID=$(cat $DIRROOT/captain-helper-api.txt)
kill -9 $FPID
rm -rf $DIRROOT/captain-helper-api.txt
echo "captain-helper-api-1.0.0 success"
else
echo "captain-helper-api-1.0.0 has been stoped..."
fi
}
function restart() {
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>now is restarting captain-helper-api......
if [ -f $DIRROOT/captain-helper-api.txt ]; then
FPID=$(cat $DIRROOT/pid_ivbis.txt)
kill -9 $FPID
rm -rf $DIRROOT/captain-helper-api.txt
echo "captain-helper-api-1.0.0 success"
else
echo "captain-helper-api-1.0.0 has been stoped..."
fi
export LD_LIBRARY_PATH=$DIRROOT/sdk
nohup java -Dspring.config.location=$DIRROOT/datas/application.properties -jar $DIRROOT/captain-helper-api-1.0.0.jar >/dev/null 2>&1 &
}
function install() {
cat >/etc/systemd/system/captain-helper-api.service EOL
[Unit]
Description=Hisign captain-helper-api System
After=network.target
[Service]
Type=forking
ExecStart=$DIRROOT/captain-helper-api start
ExecReload=$DIRROOT/captain-helper-api restart
ExecStop=$DIRROOT/captain-helper-api stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOL
systemctl daemon-reload
}
function uninstall() {
systemctl daemon-reload
systemctl stop captain-helper-api.service
systemctl disable captain-helper-api.service
rm -f /etc/systemd/system/captain-helper-api.service
systemctl daemon-reload
}
if [[ "$1" = "start" ]]; then
start
elif [[ "$1" = "stop" ]]; then
stop
elif [[ "$1" = "install" ]]; then
install
elif [[ "$1" = "uninstall" ]]; then
uninstall
elif [[ "$1" = "restart" ]]; then
restart
else
echo "captain-helper-api (start/stop/restart/install/uninstall) version: captain-helper-api-1.0.0 "
fi
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
相关推荐: 子矩形计数(多少个面积为k的全1子矩阵)【思维,两个一维数组相乘得到矩阵,计算一维数组中长度为x的全1子段】
3617. 子矩形计数(多少个面积为k的全1子矩阵) 输入样例1: 3 3 2 1 0 1 1 1 1 输出样例1: 4 输入样例2: 3 5 4 1 1 1 1 1 1 1 1 输出样例2: 14 #include using namespace std; …