From 5b6210e381a55adc4f701b9e0f093434c72bbd95 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Fri, 4 Jul 2008 04:50:20 +0000 Subject: Always run openntpd as a client Setup listeners if the service is requested --- etc/inc/system.inc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'etc') diff --git a/etc/inc/system.inc b/etc/inc/system.inc index dbef8f7..66b4d8d 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1046,8 +1046,6 @@ function system_ntp_configure() { $syscfg = $config['system']; - if (!$config['installedpackages']['openntpd']) - return; /* open configuration for wrting or bail */ $fd = fopen("{$g['varetc_path']}/ntpd.conf","w"); @@ -1064,16 +1062,19 @@ function system_ntp_configure() { 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"); + /* Setup listener(s) if the user has configured one */ + if ($config['installedpackages']['openntpd']) { + /* server config is in coregui */ + $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"); + } } } -- cgit v1.1