FreeNAS Code
This project has moved to github - see https://github.com/freenas
Brought to you by:
cochard,
mattolander
#!/bin/sh # Copyright (c) 2007-2009 Volker Theile (votdev@gmx.de) # All rights reserved. # PROVIDE: hosts # REQUIRE: var # BEFORE: netif . /etc/configxml.subr echo "Updating hosts." # Generate /etc/hosts file /usr/local/bin/xml sel -t -m "//system" \ -v "concat('::1 localhost localhost.',domain)" -n \ -v "concat('127.0.0.1 localhost localhost.',domain)" -n \ -i "//interfaces/lan/ipaddr[. != 'dhcp']" \ -v "concat(//interfaces/lan/ipaddr,' ',hostname,'.',domain,' ',hostname)" -n \ -b \ -m "//system/hosts" \ -i "string-length(name) > 0" -v "concat(address,' ',name)" -n -b \ -b \ ${configxml_file} | /usr/local/bin/xml unesc > /etc/hosts # Generate /etc/hosts.allow file /usr/local/bin/xml sel -t -m "//system/hostsacl/rule" \ -v "." -n \ ${configxml_file} | /usr/local/bin/xml unesc > /etc/hosts.allow