mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
xdp-dns: xdpdns init script to populate denylist
run xdp_dns in xdpdns init script to populate domain_denylist from domainfile saved from UI. either xdpdns restart or bpfire reboot, the domain_denylist is restored with domain blocklist Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/xdpdns/settings)
|
||||
|
||||
domainfile="/var/ipfire/xdpdns/domainfile"
|
||||
|
||||
load_dnsblock () {
|
||||
/usr/sbin/xdp-loader status green0 | grep -w 'xdp_dns_denylist'
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -35,6 +37,11 @@ load_dnsblock () {
|
||||
fi
|
||||
# allow WUI nobody with permission to update map
|
||||
chown -R nobody /sys/fs/bpf/xdp-dns-denylist
|
||||
# add domain to domain_denylist map
|
||||
while IFS= read -r line; do
|
||||
xdp_dns add $line
|
||||
done < $domainfile
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user