sk_pay/pay_reboot.sh

18 lines
680 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
. /etc/profile
process_name=idip
# 使用ps命令查找进程并将结果保存到变量中
process_count=`ps -ef|grep java|grep "${process_name}"|awk '{print $2}'`
# 判断进程数是否大于0如果大于0则进程存在否则进程不存在
if [ -z "$process_count" ]; then
echo "进程 $process_name 不存在."
else
echo "进程 $process_name 存在."
kill $process_count
sleep 3
fi
paths="/data/shikong/idip"
nohup java -jar -Xms512m -Xmx512m -Xss256K -XX:MaxMetaspaceSize=128m -XX:CompressedClassSpaceSize=64m -Dspring.config.location=${paths}/application.properties ${paths}/idip-1.0-SNAPSHOT.jar >${paths}/delivery-server.log &