Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit 70f436e

Browse files
author
ticevi
committed
using 'DHCPD_PROTOCOL' as variable
1 parent 5e73523 commit 70f436e

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ RUN apt-get -q -y update \
1212
&& apt-get -q -y clean \
1313
&& rm -rf /var/lib/apt/lists/*
1414

15+
ENV DHCPD_PROTOCOL=4
16+
1517
COPY util/entrypoint.sh /entrypoint.sh
1618
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile.ldap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ RUN apt-get -q -y update \
1212
&& apt-get -q -y clean \
1313
&& rm -rf /var/lib/apt/lists/*
1414

15+
ENV DHCPD_PROTOCOL=4
16+
1517
COPY util/entrypoint.sh /entrypoint.sh
1618
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DHCPv6
3939

4040
To use a DHCPv6-Server you have to pass `DHCPv6` as enviroment variable
4141

42-
`docker run -it --rm --init -e DHCPv6 --net host -v "$(pwd)/data":/data networkboot/dhcpd eth0`
42+
`docker run -it --rm --init -e DHCPD_PROTOCOL=6 --net host -v "$(pwd)/data":/data networkboot/dhcpd eth0`
4343

4444

4545
Notes

util/entrypoint.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ if [ -n "$IFACE" ]; then
6969
echo "You must add the 'docker run' option '--net=host' if you want to provide DHCP service to the host network."
7070
fi
7171

72-
# check if v6 should be used
73-
if [ -n "$DHCPv6"]; then
74-
$run /usr/sbin/dhcpd -6 -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE
75-
else
76-
$run /usr/sbin/dhcpd -4 -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE
77-
fi
72+
$run /usr/sbin/dhcpd -$DHCPD_PROTOCOL -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE
7873
else
7974
# Run another binary
8075
$run "$@"

0 commit comments

Comments
 (0)