[BlueOnyx:10829] Re: question inre fixhosts (#2)
Michael Stauber
mstauber at blueonyx.it
Mon Jun 18 17:09:32 -05 2012
Hi Larry,
> (sending again since not sure if original made it)...
It made it. Just haven't had the time to answer yet.
> Just curious, but why was the "test" removed from the
> /usr/sausalito/constructor/base/vsite/fixhosts file ???
>
> Previous it was testing to see if the IP was already in the file,
> (the cat /etc/hosts | grep $ip 2>/dev/null line)
> which was followed by the test ( if $? != 0) and it added the line
> in. Now it just adds every IP the box has with the name of the
> primary IP of the box itself everytime it runs and mucks up my
> hostname fixes
> (I edit the host file and fix the names so that sendmail answers
> correctly).
Well, the tests were only working right if you added a site. But on
Vsite renames or deletes it would leave the old entries in, which could
lead to undesireable results.
Short of dumping the shell script and rewriting it properly in Perl I
threw out the test as an interim measure. The file is now recreated from
scratch every time around and all the existing Vsites are added to it.
It's not perfect and in the longer run I will create a Perl script that
does a better job, but what's there now is defenitely better than what
we had before.
--
With best regards,
Michael Stauber
More information about the Blueonyx
mailing list