/ Published in: Bash
This command will force all mounted AFP network drive to disconnect. I've set this to run automatically each time my laptop sleeps so that if I wake it up on a different network Finder won't freak out.
Expand |
Embed | Plain Text
mount | awk '/^afp_/ { system("umount -f " $3) }'
Comments
Subscribe to comments
You need to login to post a comment.

Note this does not work if the mounted network drive contains a space, eg "/Volumes/Some Stuff/", as drive name will then be split over 2 columns. I cannot provide a solution in awk as I don't know it well enough, but I may write a perl script to parse drive info instead.