[Tfug] Running Script Based on Kernel Name

TR trexx at pobox.com
Mon Oct 29 12:05:25 MST 2007


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
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>




More information about the tfug mailing list