Dhcp-script for Pi-Hole 6

My setup:

> sudo pihole -v                                                                                                                                                      
Core version is v6.1.4 (Latest: N/A)
Web version is v6.2.1 (Latest: N/A)
FTL version is v6.2.3 (Latest: N/A)
> uname -a
Linux c3pio 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux

I activated the option misc.etc_dnsmasq_d and made sure the .conf file I put in /etc/dnsmaq.d/ is world-readable. The file uses the dhcp-script= setting to point to an executable bash script.

> cat /etc/dnsmasq.d/01-dhcp-script.conf
dhcp-script=/home/pi/bin/dhcpupdate.sh

To see if this is working I am just logging the received arguments:

> cat /home/pi/bin/dhcpupdate.sh
#!/bin/bash
logger "dhcp script: $1 $2 $3 $4"

It seems that the configuration isn’t being picked up. What am I missing?

Try making the folder /home/pi searchable for everyone (my default is 700) eg:

chmod +x /home/pi

Works for me:

$ sudo journalctl --full --no-hostname --follow
[..]
Oct 14 19:57:52 pihole[28448]: dhcp script: old 0c:2f:b0:XX:XX:XX 10.0.0.143 hakpc

FYI, from a touch added to the script, it seems the script is run as the pihole user:

$ stat /tmp/dhcp
[..]
Access: (0644/-rw-r--r--)  Uid: (  995/  pihole)   Gid: ( 1001/  pihole)

Access rights seem to have been the issue. It is working now. Thanks!