Advertisement
Guest User

Untitled

a guest
Nov 1st, 2011
2,592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/sh -e
  2. # Replacement for upstream mount helper using udisks/eject
  3. # (C) 2010 Martin Pitt <mpitt@debian.org>
  4.  
  5. ACTION="$1"
  6. DEV="$2"
  7.  
  8. case "$ACTION" in
  9. mount)
  10. udisks --mount "$DEV"
  11.  
  12. # check if mount worked. If not, fail
  13. # udisks does return 0 even if mount failed
  14. mount | grep -q "$DEV" || exit 0
  15. ;;
  16.  
  17. eject)
  18. eject "$DEV"
  19. ;;
  20.  
  21. cleanup)
  22. ;;
  23.  
  24. *)
  25. echo "unknown action" >&2
  26. exit 1
  27. esac
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement