add status command for piflow

This commit is contained in:
judy0131 2019-07-29 16:08:15 +08:00
parent 8b88500c1e
commit 58f710867d
3 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,4 @@
1.build piflow-server-0.9.jar, copy it to folder --- lib
1.build piflow-server-0.9.jar, copy it to folder --- ./lib
2.set PIFLOW_HOME
vim /etc/profile

View File

@ -2,5 +2,5 @@
#java -cp piflow-server-0.9.jar:./classpath/piflow-external.jar cn.piflow.api.Main
#java -cp piflow-server-0.9.jar:./classpath/* cn.piflow.api.Main
nohup java -cp ./lib/piflow-server-0.9.jar:./classpath/* cn.piflow.api.Main > ./logs/piflow.log 2>&1 &
echo "check log in piflow.log"
echo "check log in logs/piflow.log"

18
piflow-bin/status.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
#ps term
function check_status()
{
[ ${#} -eq 0 ] && echo "usage: $FUNCNAME STRING" && return 0
local pid
pid=$(ps ax | grep "$1" | grep -v grep | awk '{ print $1 }')
if [ $pid != "" ]
then
echo "server is Running!"
port=$(netstat -nltp | grep $pid | awk '{print $4}')
echo "$port"
else
echo "Server is Stopped!"
fi
}
check_status piflow.api.Main