summaryrefslogtreecommitdiff
path: root/libre/calibre-libre/calibre-mount-helper
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-12-22 02:49:14 -0800
committerroot <root@rshg054.dnsready.net>2012-12-22 02:49:14 -0800
commit0f92922979ec1f52c580079a4a49a7dc84af4ca1 (patch)
treefe2e215e3c2e3b9f297f1196511be57fcb5701d8 /libre/calibre-libre/calibre-mount-helper
parentebf350f32a8352abbd1bb4a8a49ed750bb23f285 (diff)
Sat Dec 22 02:47:27 PST 2012
Diffstat (limited to 'libre/calibre-libre/calibre-mount-helper')
-rw-r--r--libre/calibre-libre/calibre-mount-helper28
1 files changed, 28 insertions, 0 deletions
diff --git a/libre/calibre-libre/calibre-mount-helper b/libre/calibre-libre/calibre-mount-helper
new file mode 100644
index 000000000..00cac4270
--- /dev/null
+++ b/libre/calibre-libre/calibre-mount-helper
@@ -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
+