[osiris-devel] Fwd: [osiris] Distro specific init scripts
Brian Wotring
brian at shmoo.com
Mon Mar 8 11:51:47 EST 2004
I can take care of it. The basic idea is that these distro specific
init scripts will be used when possible, and the installer will resort
to using the current (generic) script otherwise.
I'm fine with using proc to get this info, unless someone can think of
reasons as to why this would not be a good idea.
Begin forwarded message:
> From: Thomas Jones <thomas.jones at linux-howtos.com>
> Date: March 7, 2004 8:46:45 PM MST
> To: osiris at lists.shmoo.com
> Subject: Re: [osiris] Distro specific init scripts
> Reply-To: Osiris Users <osiris at lists.shmoo.com>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Monday 08 March 2004 08:22, Brian Wotring wrote:
>> These look good. Do you know where any identifying files are for
>> these
>> distros (SuSE and Debian)? That is, do you know if they have a file
>> similar to redhat's /etc/redhat-release?
>>
> Well i had been trying to construct a all-in-one init script that
> determined
> the host system. I came across a few problems -- one being i kept
> getting the
> dreaded EOF from cut-and=paste. aarrrgghh!!! In restrospect, i could
> have
> used a hex editor to find it. oh well.
>
> Anyways, to answer your question this is what i came up with:
>
> <code>
> if [[ ${DISTRO} == "" ]];
> then
> if [ -e /proc/version ];
> then
> DISTRO=`cat /proc/version | grep -o -e 'SuSE' -e
> 'Redhat' -e
> 'Debian'`
> else
> ${ECHO} "Unable to determine the host distribution.
> Please
> set"
> ${ECHO} "the DISTRO variable manually."
> fi
> fi
> </code>
>
> I first attempted to use other files such as debian's
> /etc/debian-version,
> suse's /etc/SuSE-release. But IMHO, the /proc/version should be the
> proper
> place to extract the info. However, again; it would be easy to change
> over o
> these files as well for info.
>
> The extended patterm matching was the best, most efficient command i
> could
> construct. Nested if's would work; but seems a bit overkill for the
> use.
>
> What do you think? Do you want me to finish the all-in-one using
> either of
> these scenarios ---- or do you want to take care of it?
>
> ;)
> Thomas
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
> Comment: 'Thomas Jones Package Signing Key'
>
> iD8DBQFAS+ysQT2komo99ukRAumrAJ9Ej4gDrdTfsu7xay0x8OjFulAO3gCgt1sr
> mEX1ZbYYoHcFNNAVs0z2CLk=
> =pKDq
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> osiris mailing list
> osiris at lists.shmoo.com
> https://lists.shmoo.com/mailman/listinfo/osiris
>
>
--
Brian Wotring ( brian at shmoo.com )
PGP KeyID: 0x9674763D
More information about the osiris-devel
mailing list