File: hal-unmount.dev

package info (click to toggle)
hal 0.4.7-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,544 kB
  • ctags: 4
  • sloc: sh: 149; makefile: 28
file content (16 lines) | stat: -rw-r--r-- 398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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