]> git.pld-linux.org Git - packages/calibre.git/blobdiff - calibre-mount-helper
- rel 2
[packages/calibre.git] / calibre-mount-helper
diff --git a/calibre-mount-helper b/calibre-mount-helper
new file mode 100644 (file)
index 0000000..00cac42
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+# Replacement for upstream mount helper using udisks/eject
+# (C) 2010 Martin Pitt <mpitt@debian.org>
+
+ACTION="$1"
+DEV="$2"
+
+case "$ACTION" in
+    mount)
+       udisks --mount "$DEV"
+    
+       # check if mount worked. If not, fail
+       # udisks does return 0 even if mount failed
+       mount | grep -q "$DEV" || exit 0
+       ;;
+
+    eject)
+       eject "$DEV"
+       ;;
+
+    cleanup)
+       ;;
+
+    *)
+       echo "unknown action" >&2
+       exit 1
+esac
+
This page took 0.104867 seconds and 4 git commands to generate.