From 1348b5a404740e9f2a4bb99949533d7587b11af7 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 22 Nov 2006 11:17:58 +0100 Subject: [PATCH] Avoid syntax error in dhcpd.conf if values for DNS and Gateway are empty, thanks for the patch - Wolfgang Karall! --- debian/changelog | 7 +++++++ templates/dhcpd_config | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7a3bf35..48f2d55 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-terminalserver (0.77) unstable; urgency=low + + * Avoid syntax error in dhcpd.conf if values for DNS and Gateway + are empty, thanks for the patch - Wolfgang Karall! + + -- Michael Prokop Wed, 22 Nov 2006 11:16:46 +0100 + grml-terminalserver (0.76) unstable; urgency=low * Support bootoption dhcp_iface via /linuxrc for selection of diff --git a/templates/dhcpd_config b/templates/dhcpd_config index 2b847c7..824b42e 100644 --- a/templates/dhcpd_config +++ b/templates/dhcpd_config @@ -24,8 +24,13 @@ date_=`execute date warn` # insert commas when having multiple nameservers -DNS_=$(echo "$NAMESERVERS_" | sed -e 's/\([0-9]\) \([0-9]\)/\1, \2/g') +if [ -n "$NAMESERVERS_" ]; then + DNS_LINE_="option domain-name-servers $(echo "$NAMESERVERS_" | sed -e 's/\([0-9]\) \([0-9]\)/\1, \2/g');" +fi # note: we don't support multiple routers options +if [ -n "$GW_" ]; then + ROUTERS_LINE_="option routers $GW_;" +fi cat >"$DHCPD_CONFIG_FILE_" <