add status command for piflow
This commit is contained in:
parent
8b88500c1e
commit
58f710867d
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue