Brian Servis wrote:
>
> 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!