[Tfug] Running Script Based on Kernel Name

Andrew Ayre andy at britishideas.com
Mon Oct 29 15:48:09 MST 2007


Perfect, thanks! Andy

TR wrote:
> Name the scripts
> SOMETHINGrealtime and SOMETHINGRTAI
> then invoke with
> $>  SOMETHING`uname -r|sed s/[0-9.\-]*//`
> 
> 
> On 10/29/07, Andrew Ayre <andy at britishideas.com> wrote:
>> I now have two kernels to choose from in Grub. One contains "generic" in
>> the name and the other contains "realtime" in the name, with the
>> realtime kernel having RTAI support.
>>
>> My next problem is that I need to run a couple of commands at startup
>> and shutdown when the realtime kernel is used, but not when the generic
>> kernel is used.
>>
>> Is there a standard way of doing this or do I need to write a shell
>> script that greps uname -a for "realtime"? I'm not really familiar with
>> shell scripting - anyone know of an example of an if statement grepping
>> uname -a output for an (arbitary) string?
>>
>> thanks for the help! Andy
>>

-- 
Andy
PGP Key ID: 0x67090A54




More information about the tfug mailing list