diff --git a/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard b/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard index 6fec481d..053baf0f 100755 --- a/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard +++ b/package/secubox/luci-app-crowdsec-dashboard/root/usr/libexec/rpcd/luci.crowdsec-dashboard @@ -15,12 +15,18 @@ secubox_log() { CSCLI="/usr/bin/cscli" -# Check if cscli exists +# Check if cscli exists and crowdsec is running check_cscli() { if [ ! -x "$CSCLI" ]; then echo '{"error": "cscli not found"}' exit 1 fi + + # Check if crowdsec service is running + if ! pgrep -x crowdsec >/dev/null 2>&1; then + echo '{"error": "crowdsec service not running"}' + exit 1 + fi } # Get decisions list