pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kernel detection in /etc/rc.conf

On Sun, 22 May 2011, Sverre Froyen wrote:
Is there a way to detect kernel version in /etc/rc.conf. I am attempting
something like the following:

if uname -v | grep XEN3_DOM0 > /dev/null

My way to do simple substring tests like this before awk, sed, grep, etc. are necessarily available is to use case, e.g.

case $(sysctl -n machdep.booted_kernel) in
        do stuff
        do other stuff

For example:


Home | Main Index | Thread Index | Old Index