hi ya brian...hi peter

i was just thinking of a different way ( script ) tooo...

problem is if win95 ( viritual host stays down )...no problem
the script mounts it...and we're done...

but while mounted... someone fires up the win95 virtual host w/ vmware...
than you are asking for disaster..

if it was already up... than autofs can figure out what to do...

have fun linuxing
alvin


#!/usr/bin/perl
#
# Ping the known desired host...
#       if its there...autofs will do the magic
#       if its not there...autofs mount it differently ??
#
# printf using peter's method...
#
` ping -c 1 win95 `;

if ( $? ) {
  # win95 there  ( use nfs )
  printf "-fstype=nfs,rsize=8192,wsize=8192 Win95.mydomain.com:/export";
}
else {
  # win95 not there - ( use vfat on local partition )
  printf "-fstype=vfat,rsize=8192,wsize=8192 :/dev/hdaxxx";
}
#
# end of file

> > If I understand the principle of program map types the 'program' is
> > executed and then returns something(what?) to automount to continue
> > with the mount.  If this is the case then I would like the program to
> > determine the state of the guest os and return what is necessary to
> > automount to either mount the vfat drives natively or via smbmount. I
> > can do this.
> > 
> > I just don't know how the program maps are defined or setup or
> > anything in the autofs files.  There are no examples in any of the docs
> > that I could find of using program map types.  If I could find some
> > examples of a program map type I probably could figure it out on my
> > own.
> > 
> 
> The program map gets passed the key as the argument, and you need have
> the program map output whatever you would put beside the key in a file
> map.  If it returns a nonzero exit code that is considered a failed
> lookup.  For example, here is a shell script program map that returns
> one of two servers depending on the first letter of the key:
> 
> #!/bin/sh -
> #
> # letter_map
> #
> l1=`echo "$1" | cut -c1`
> 
> case "$l1" in
>       [a-e])  server=a-e      ;;
>       [f-p])  server=f-p      ;;
>       [q-z])  server=q-z      ;;
>       *)      exit 1          ;;      # Invalid key
> esac
> 
> echo "-fstype=nfs,rsize=8192,wsize=8192 $server.mydomain.com:/export"
> exit 0
> 
> -- 
> <[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
> 

Reply via email to