#!/bin/sh # $Header: /root/magellan-cvs/src/hal/hal-unmount.dev,v 1.1 2006-10-20 18:01:50 niro Exp $ # sanity check. DEVNAME should start with a / [ "$DEVNAME" != "${DEVNAME#/}" ] || exit 0 # Lazily unmount drives which are removed, but still mounted if [ "$ACTION" = remove ] \ && (grep -q "^$DEVNAME" /proc/mounts || grep -q "^$DEVNAME" /etc/mtab); then if [ -x /usr/bin/pumount ] ; then /usr/bin/pumount -l "$DEVNAME"; else /bin/umount -l "$DEVNAME"; fi fi exit 0