You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tde-packaging-gentoo/sys-apps/hal/files/hal-unmount.dev

18 lines
397 B

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