View Single Post
  #9  
Old 05-11-2007, 12:56 AM
afragen afragen is offline
Registered User
 
Join Date: May 2007
Location: Southern California
Posts: 13
Send a message via AIM to afragen
Quote:
Originally Posted by dnanian View Post
and assumes that there's a single network volume attached.!
This will/should work for multiple attached network AFP mounts. I'm sure something similar would work for any other mount type.

Code:
#!/usr/bin/env bash

sleep 45

if [[ `mount | awk '/^afp_/'` != "" ]]; then
  num_mounts=`mount | grep -c ^afp`
  for (( i = 0; i < $num_mounts; i++ )); do
    afp=`mount | grep ^afp_ | awk {'print$3'} | sed -n '1p;1q'`
    umount -f $afp
  done
fi
Andy

Last edited by afragen; 05-11-2007 at 02:19 AM.
Reply With Quote