fix: CrowdSec RPC process detection
Fixed pgrep command to detect running CrowdSec process: - Changed from `pgrep -x crowdsec` to `pgrep crowdsec` - The -x flag requires exact process name match which wasn't working - Affects both check_cscli() and get_status() functions - Now correctly detects service as running in dashboard 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d1788a12ff
commit
878faf5bec
@ -23,7 +23,7 @@ check_cscli() {
|
||||
fi
|
||||
|
||||
# Check if crowdsec service is running
|
||||
if ! pgrep -x crowdsec >/dev/null 2>&1; then
|
||||
if ! pgrep crowdsec >/dev/null 2>&1; then
|
||||
echo '{"error": "crowdsec service not running"}'
|
||||
exit 1
|
||||
fi
|
||||
@ -107,7 +107,7 @@ get_status() {
|
||||
json_init
|
||||
|
||||
# CrowdSec service
|
||||
if pgrep -x crowdsec >/dev/null 2>&1; then
|
||||
if pgrep crowdsec >/dev/null 2>&1; then
|
||||
json_add_string "crowdsec" "running"
|
||||
else
|
||||
json_add_string "crowdsec" "stopped"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user