From 291492467fad88158d0b092e7b40ac71ac4fa29b Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Sat, 1 Oct 2011 20:19:30 +0200 Subject: [PATCH] Add static host entries to separate file and include in main config --- etc/inc/unbound.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index e6d8ad097c..a960ff7314 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -286,6 +286,9 @@ interface: ::0 {$private_addr} {$private_domains} +# Static host entries +include: {$g['unbound_chroot_path']}/etc/host_entries + ### # Remote Control Config ### @@ -303,7 +306,7 @@ EOD; } function unbound_add_host_entries() { - global $config; + global $config, $g; /* XXX: break this out into a separate config file and make use of include */ $syscfg = $config['system']; @@ -394,7 +397,9 @@ function unbound_add_host_entries() { } $unbound_entries .= $host_entries; } - return $unbound_entries; + + /* Write out entries */ + file_put_contents("{$g['unbound_chroot_path']}/etc/host_entries", $unbound_entries); } ?> \ No newline at end of file