Quote:
Originally Posted by dnanian
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