Skip to content

Commit 34a20c4

Browse files
committed
add func check chilli status
1 parent 7d18bd6 commit 34a20c4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

conf/functions.in

+17
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ $*
7777
EOF
7878
}
7979
80+
status() {
81+
PIDFILE=$1
82+
if [ -f $PIDFILE ]; then
83+
pid=$(cat $PIDFILE)
84+
if ps -p $pid > /dev/null; then
85+
echo "$NAME is running (pid $pid)"
86+
return 0
87+
else
88+
echo "$NAME is not running, but pid file exists"
89+
return 1
90+
fi
91+
else
92+
echo "$NAME is not running"
93+
return 3
94+
fi
95+
}
96+
8097
writeconfig1() {
8198
cat <<EOF
8299
# THIS FILE IS AUTOMATICALLY GENERATED

0 commit comments

Comments
 (0)