1
General Discussion / Re: Execute custom script on DHCP commit
« on: January 16, 2024, 08:18:33 pm »
I do something similar in my own setup.
Try placing your script in /var/dhcpd/usr/local/sbin/oncommit instead, and then updating your on commit hook to use the path /usr/local/sbin/oncommit
Also, instead of editing the .inc files, which will get overwritten on an update, you should create a separate .conf file in the folder /usr/local/etc/dhcpd.opnsense.d/ (for v4) or /usr/local/etc/dhcpd6.opnsense.d/ (for v6) as suggested by the documentation here: https://docs.opnsense.org/manual/dhcp.html#advanced-settings
Try placing your script in /var/dhcpd/usr/local/sbin/oncommit instead, and then updating your on commit hook to use the path /usr/local/sbin/oncommit
Also, instead of editing the .inc files, which will get overwritten on an update, you should create a separate .conf file in the folder /usr/local/etc/dhcpd.opnsense.d/ (for v4) or /usr/local/etc/dhcpd6.opnsense.d/ (for v6) as suggested by the documentation here: https://docs.opnsense.org/manual/dhcp.html#advanced-settings