Files
sablink-distro/sys-apps/hal/files/hal-unmount.dev
T
lxnay f8728c987a new version syncing patches with gentoo
git-svn-id: http://svn.sabayonlinux.org/overlay@1360 d7aec97c-591d-0410-af39-a8856400b30a
2007-06-15 10:19:04 +00:00

18 lines
397 B
Bash

#!/bin/sh
# 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