diff options
author | Ermal <eri@pfsense.org> | 2010-03-24 15:48:11 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-24 15:54:01 +0000 |
commit | f38f806257eb5209adb315b99b42c6d9d943b4dc (patch) | |
tree | 43bcc62ed82d0836183298c505330316cf471644 /etc | |
parent | 6f02633de9548df02feb9399fe36cf0c78f6205a (diff) | |
download | pfsense-f38f806257eb5209adb315b99b42c6d9d943b4dc.zip pfsense-f38f806257eb5209adb315b99b42c6d9d943b4dc.tar.gz |
Generate hosts entries for all ips configured.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 73e241c..39fcd60 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -177,8 +177,6 @@ function system_hosts_generate() { } $syscfg = $config['system']; - $lancfg = $config['interfaces']['lan']; - $lancfgip = get_interface_ip("lan"); $dnsmasqcfg = $config['dnsmasq']; if (!is_array($dnsmasqcfg['hosts'])) { @@ -192,15 +190,14 @@ function system_hosts_generate() { return 1; } - $hosts = <<<EOD -127.0.0.1 localhost localhost.{$syscfg['domain']} + $hosts .= "127.0.0.1 localhost localhost.{$syscfg['domain']}\n"; -EOD; - if (is_ipaddr($lancfgip)) - $hosts .= <<<EOD -{$lancfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']} - -EOD; + $sysiflist = get_configured_interface_list(); + foreach ($sysiflist as $sysif) { + $cfgip = get_interface_ip($sysif); + if (is_ipaddr($cfgip)) + $hosts .= "{$cfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n"; + } foreach ($hostscfg as $host) { if ($host['host']) |