From 34a20c43e4060c5df8062250a6cef335ffde7bf3 Mon Sep 17 00:00:00 2001 From: bankjirapan Date: Sun, 30 Jun 2024 22:33:15 +0700 Subject: [PATCH] add func check chilli status --- conf/functions.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/conf/functions.in b/conf/functions.in index 58ce43b7..24ae38a4 100644 --- a/conf/functions.in +++ b/conf/functions.in @@ -77,6 +77,23 @@ $* EOF } +status() { + PIDFILE=$1 + if [ -f $PIDFILE ]; then + pid=$(cat $PIDFILE) + if ps -p $pid > /dev/null; then + echo "$NAME is running (pid $pid)" + return 0 + else + echo "$NAME is not running, but pid file exists" + return 1 + fi + else + echo "$NAME is not running" + return 3 + fi +} + writeconfig1() { cat <