From 95594e5aadbed02594326ac7908138d46f2c5332 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 20 Mar 2007 17:24:17 +0000 Subject: Add missing text from ntp configure --- etc/inc/system.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'etc/inc/system.inc') diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 6c5210d..dca76c0 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1001,10 +1001,22 @@ function system_ntp_configure() { fwrite($fd, "# \n\n"); /* foreach through servers and write out to ntpd.conf */ - $timeservers = ""; foreach (explode(' ', $syscfg['timeservers']) as $ts) fwrite($fd, "servers {$ts}\n"); + /* server config is in coregui1 */ + $xmlsettings = $config['installedpackages']['openntpd']['config'][0]; + if ($xmlsettings['enable'] == 'on') { + $ifaces = explode(',', $xmlsettings['interface']); + $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces); + $ifaces = array_filter($ifaces, 'does_interface_exist'); + $ips = array_map('find_interface_ip', $ifaces); + foreach ($ips as $ip) { + if (is_ipaddr($ip)) + fwrite($fd, "listen on $ip\n"); + } + } + fwrite($fd, "\n"); /* slurp! */ @@ -1231,4 +1243,4 @@ function enable_watchdog() { } } -?> \ No newline at end of file +?> -- cgit v1.1