dhcpd-docker/rootfs/usr/local/bin/entrypoint.sh

11 lines
406 B
Bash
Raw Permalink Normal View History

2021-08-31 15:52:39 +00:00
#!/bin/bash
mkdir --parents /etc/dhcp/ mkdir --parents /run/dhcpd{4,6} || true
if [ "${DHCP_IP+x}" = "x" ] && [ ${DHCP_IP} == "6" ]; then
touch /var/lib/dhcp/dhcpd6.leases
/usr/bin/dhcpd -6 -cf /etc/dhcp/dhcpd6.conf -pf /run/dhcpd6/dhcpd.pid -d ${DHCP_INTERFACES}
else
touch /var/lib/dhcp/dhcpd.leases
/usr/bin/dhcpd -4 -cf /etc/dhcp/dhcpd.conf -pf /run/dhcpd4/dhcpd.pid -d ${DHCP_INTERFACES}
fi