mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
xdp-dns UI: change running state check
Status relies on checking if xdp_dns_log is running, but xdp_dns_log could mysteriously disappear at some point, which result in XDP DNS Blocklist shows Stopped, let /etc/rc.d/init.d/xdpdns status relies on if the xdp_dns_denylist XDP program is still attached to green0 interface. two related issues https://github.com/vincentmli/BPFire/issues/50 https://github.com/vincentmli/BPFire/issues/49 Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -55,6 +55,15 @@ unload_dnsblock () {
|
||||
fi
|
||||
}
|
||||
|
||||
is_xdpdns_attached () {
|
||||
/usr/sbin/xdp-loader status green0 | grep -w 'xdp_dns_denylist' >> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "xdp_dns_denylist is attached to green0"
|
||||
else
|
||||
echo "xdp_dns_denylist is not attached to green0"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
@@ -74,7 +83,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
status)
|
||||
statusproc /usr/sbin/xdp_dns_log
|
||||
is_xdpdns_attached
|
||||
;;
|
||||
|
||||
restart)
|
||||
|
||||
Reference in New Issue
Block a user