Thanks Peter and Alvin!

It is all working now.  This program map is very cool.  I could see
some really tricky mounts taking place with this tool.  My first vision
is using a program map to find the fastest nfs mirror of some software
archive and mounting it.  All kinds of fun stuff could be done.

Here is my program map in all its ugly glory.  It may not be an example
of good script code but it works.

#!/bin/sh
    
# get the key
key=`echo "$1" | cut -c1`
    
# assume the guest os is not up and a local mount will be done
local=1
    
# check to see if the guest os is up, if it is set the local flag to 0
fping -q brianvm && local=0

# reverse the logic so that the else will always mount locally 
if [ $local = 0 ]   # setup the mount for a samba mount using smbfs
then
    case "$key" in
        [c-g])  partition=$key          ;;
        *)      exit 1                  ;;      # invalid key
    esac
    echo "-fstype=smbfs,guest,uid=0,gid=35,filemode=660 ://brianvm/$partition"
else  # set up the mount for a local mount using vfat fs
    case "$key" in
        c)      partition=/dev/hda1     ;;
        d)      partition=/dev/hda5     ;;
        e)      partition=/dev/hda6     ;;
        f)      partition=/dev/hda7     ;;
        g)      partition=/dev/hdc5     ;;
        *)      exit 1                  ;;      # Invalid key
    esac
    echo "-fstype=vfat,uid=0,gid=35,umask=007,rw,unhide,quiet :$partition"
fi
exit 0

-- 
Brian 
---------------------------------------------------------------------
Mechanical Engineering                              [EMAIL PROTECTED]
Purdue University                   http://www.ecn.purdue.edu/~servis
---------------------------------------------------------------------

Reply via email to