Re: New Init script
Steve G <[email protected]> Sun, 8 Feb 2004 05:59:20 -0800 (PST)
| Newsgroups | gmane.network.zeroconf.workers |
|---|---|
| Message-ID | <[email protected]> |
>I have commited your changes (including the bugfixes)
>to the cvs.
Thanks.
>Is there something one could tell that the system actually
>is mandrake ?
Yes, there are 2 ways. The first is to cat /etc/issue and grep.
However, it is common practice for the paranoid to replace
/etc/issue with something that doesn't identify the OS. So, we
can fallback to doing an rpm -qa and grepping for release. This
takes longer but is more likely to be accurate.
Example:
#!/bin/bash
# First try the quick test
if [ -f /etc/issue ] ; then
temp=`cat /etc/issue | grep 'Red Hat'`
if test ".${temp}" != "." ; then
echo "This is Red Hat"
exit 0
else
temp=`cat /etc/issue | grep 'andrake'`
if test ".${temp}" != "." ; then
echo "This is Mandrake"
exit 0
fi
fi
fi
# That didn't work, try the longer test
temp=`rpm -qa | grep release`
if test ".${temp}" = "." ; then
echo "rpm returned nothing"
else
u=`echo $temp | grep 'andrake'`
if test ".${u}" = "." ; then
u=`echo $temp | grep 'edhat'`
if test ".${u}" = "." ; then
echo "Cannot Identify this release"
else
echo "This is Red Hat"
fi
else
echo "This is Mandrake"
fi
fi
I don't have a Suse system available to me, but it is rpm based
and should be easily added to the test.
>> The update-resolvrdv should go into the scripts directory.
>> This file was pulled from a Mandrake source rpm.
>
>Make will install it in /usr/sbin now.
Perfect.
>I did some code reorganisation in tmdns.c.
I'll pull the latest and start looking it over.
Thanks,
Steve Grubb
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn