iopsys-feed/dhcpmngr/files/etc/uci-defaults/unbound.odhcpd.uci_default
Mohd Husaam Mehdi 47fe2abfe0 dnsmngr: add unbound as selectable backend
* add dependencies for different backends in dhcpmngr and
  dnsmngr
* use CFLAG to indicate to data model code which backend is being
  used currently
* add uci-defaults script to set leasetrigger if unbound is dns
  backend
2024-08-29 09:06:15 +00:00

18 lines
562 B
Bash

#!/bin/sh
# update odhcpd uci to use unbound's script as leasetrigger
uci -q get dhcp.odhcpd >/dev/null 2>&1 && {
maindhcp="$(uci -q get dhcp.odhcpd.maindhcp)"
# if odhcpd is the main dhcp
[ "$maindhcp" = "1" ] || [ "$maindhcp" = "true" ] || [ "$maindhcp" = "on" ] && {
# if unbound daemon and unbound script file is present
[ -e /usr/lib/unbound/odhcpd.sh ] && [ -e /usr/sbin/unbound ] && {
# then set unbound script as leasetrigger in dhcp UCI
uci -q set dhcp.odhcpd.leasetrigger='/usr/lib/unbound/odhcpd.sh'
uci commit dhcp
}
}
}
exit 0