Dnsmasq detect running service

Hi,

I'm running OpenWRT as internet router and an opnSense FW on a Proxmox PVE.
Normally opnSense is serving dhcp and dns.

My goal is to let OpenWRT serve dhcp and dns in case opnSense is down.
Whether opnSense is down can be easily detected by a "ping".

The dhcp server in OpenWRT is enabled with the option:
Force DHCP on this network even if another server is detected = off

In this case the log shows:
user.notice dnsmasq: found already running DHCP-server on interface 'br-lan' refusing to start,

So far, so good.
When I start an cron-triggered script I must know in which state the dhcp service for the particular IF is at the moment.
Where do I find this information?

Thanks for the link.
But it does not solve the problem.
Dnsmasq is running; only the DHCP-server is disabled for a particular interface when dnsmasq is started:

user.notice dnsmasq: found already running DHCP-server on interface 'br-lan' refusing to start,

I want to check the DHCP-server status of br-lan.

BTW: netstat shows that dnsmasq listens on all IFs on port 67

udp 0 0 0.0.0.0:67 0.0.0.0:* 31742/dnsmasq