f8728c987a
git-svn-id: http://svn.sabayonlinux.org/overlay@1360 d7aec97c-591d-0410-af39-a8856400b30a
18 lines
397 B
Bash
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
|
|
|