diff options
author | Bill Marquette <billm@pfsense.org> | 2008-07-04 04:50:20 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2008-07-04 04:50:20 +0000 |
commit | 5b6210e381a55adc4f701b9e0f093434c72bbd95 (patch) | |
tree | b3663c801b4426339d24d4e225f74d70c5497cf5 /etc | |
parent | 0c4520d0e45b713f951555fcdb18341a2997a196 (diff) | |
download | pfsense-5b6210e381a55adc4f701b9e0f093434c72bbd95.zip pfsense-5b6210e381a55adc4f701b9e0f093434c72bbd95.tar.gz |
Always run openntpd as a client
Setup listeners if the service is requested
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 25 |
1 files changed, 13 insertions, 12 deletions
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"); + } } } |