[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting IP and Host from a flavor (formerly [ezjail] syctl resetting on jail restart)



On Tuesday 06 February 2007 1:15 am, Matt Olander wrote:
> It would be insanely slick if I could echo '$jailip  $jailname'
>
> >> /etc/hosts. Anybody know of a way to do that?

Please forgive the multiple replies to my own post, but in case anybody 
else needs it for their post installation flavor script:

echo -n `ifconfig bge0 | fgrep -w inet | awk '{print $2}'` " "  \ 
`hostname` >> /etc/hosts 

Feel free to add a \t (via printf?) and another awk on the hostname to 
grab and add the shortname from the fqdn ;-)

Regards,
-matt

-- 
Matt Olander
CTO, iXsystems - "Servers for Open Source" http://www.iXsystems.com
Public Relations, The FreeBSD Project        http://www.FreeBSD.org
BSD on the Desktop!                            http://www.pcbsd.org
Phone: (408)943-4100 ext. 113                    Fax: (408)943-4101