summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-07-12 15:04:13 +0100
committerRoy Marples <roy@marples.name>2019-07-12 15:05:11 +0100
commit5ca93a3ab42ee2293db1f84662603ec0c2966f52 (patch)
tree90f9319513f53d302bf1647d5325886aede59dbb
parent13f4485bd91585ad5902366073190273d9e0e60b (diff)
hooks: Ensure header is empty before populating it.
Thanks to Andreas
-rw-r--r--hooks/20-resolv.conf1
-rw-r--r--hooks/50-ntp.conf1
2 files changed, 2 insertions, 0 deletions
diff --git a/hooks/20-resolv.conf b/hooks/20-resolv.conf
index 61c75e82..204763be 100644
--- a/hooks/20-resolv.conf
+++ b/hooks/20-resolv.conf
@@ -19,6 +19,7 @@ build_resolv_conf()
interfaces=$(list_interfaces "$resolv_conf_dir")
# Build the resolv.conf
+ header=
if [ -n "$interfaces" ]; then
# Build the header
for x in ${interfaces}; do
diff --git a/hooks/50-ntp.conf b/hooks/50-ntp.conf
index f1736d36..4b68f777 100644
--- a/hooks/50-ntp.conf
+++ b/hooks/50-ntp.conf
@@ -62,6 +62,7 @@ build_ntp_conf()
# Build a list of interfaces
interfaces=$(list_interfaces "$ntp_conf_dir")
+ header=
servers=
if [ -n "$interfaces" ]; then
# Build the header