automount based on OS

Hi I have two different /usr/local for Solaris 8 and Solaris 9. How can I set the autofs to mount the related /usr/local based on its own OS ?Many thanks.
[182 byte] By [zhou@CMCa] at [2007-11-27 0:58:58]
# 1

# man automount

[...]

Variable Substitution

Client specific variables can be used within an automount

map. For instance, if $HOST appeared within a map, automount

would expand it to its current value for the client's host

name. Supported variables are:

[...]

OSREL The output of uname -rThe OS release name.

For example "5.3"

--

Darren

Darren_Dunhama at 2007-7-11 23:33:07 > top of Java-index,General,Sun Networking Services and Protocols...
# 2
Hi,Thanks for the info, But I still don't catch it.In my case, the auto_direct map file looks like:/usr/localsparc8,sparc9:/usr/localAccording to the man page, how to update related maps, so the solaris 9 client will mount sparc9:/usr/local ?Many thanks
zhou@CMCa at 2007-7-11 23:33:07 > top of Java-index,General,Sun Networking Services and Protocols...
# 3

You can't do that exactly with the bits that it gives you.

If your path had '5.9' in it instead of 'sparc9', you could use the variable in place of '5.9' and it would be expanded.

Instead you could set a variable explicitly in the autofs startup script.

if [ (os is Solaris 8) ] ; then

MYVAR="sparc8"

elif [(os is Solaris 9)] ; then

MYVAR="sparc9"

else

MYVAR="?"

fi

export MYVAR

[... rest of normal autofs script below]

Then you should be able to use the MYVAR in your mount line.

/usr/local $MYVAR:/usr/local

--

Darren

Darren_Dunhama at 2007-7-11 23:33:07 > top of Java-index,General,Sun Networking Services and Protocols...