summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit@wsystem.com>2015-10-25 02:59:27 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-12-24 14:57:17 +0100
commit0bc15867dad61c24769d635c31c8263695ed92c0 (patch)
treeec042fa186020c30b34f685247924c4b4fc9c833
parenta118f32e9a72994d46818b8a3374f7905967c52d (diff)
downloadbuildroot-0bc15867dad61c24769d635c31c8263695ed92c0.tar.gz
buildroot-0bc15867dad61c24769d635c31c8263695ed92c0.zip
package/dhcp: make S80dhcp-relay read a file from /etc/default/
The S80dhcp-relay init script has configuration variables like INTERFACES whose contents have to be passed to the daemon. These variables are initialized as empty strings, but some of them are not allowed to be empty and there was no means of filling them apart from creating a root FS overlay to overwrite these scripts. This commit adds support for reading dhcrelay under /etc/default/ to set these configuration variables. [Thomas: adapt to patch only S80dhcp-relay, since S80dhcp-server has already been changed by previous commits.] Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rwxr-xr-xpackage/dhcp/S80dhcp-relay4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/dhcp/S80dhcp-relay b/package/dhcp/S80dhcp-relay
index 5ee06c7133..0f383e6043 100755
--- a/package/dhcp/S80dhcp-relay
+++ b/package/dhcp/S80dhcp-relay
@@ -13,6 +13,10 @@ INTERFACES=""
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""
+# Read configuration variable file if it is present
+CFG_FILE="/etc/default/dhcrelay"
+[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
+
# Sanity checks
test -f /usr/sbin/dhcrelay || exit 0
test -n "$INTERFACES" || exit 0
OpenPOWER on IntegriCloud