mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
* 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
18 lines
562 B
Bash
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
|