summaryrefslogtreecommitdiff
path: root/libre/calibre-libre/calibre-mount-helper
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@parabola.nu>2013-01-16 14:55:14 -0300
committerNicolás Reynolds <fauno@parabola.nu>2013-01-16 14:55:14 -0300
commit937c8656ecd59d9800c7d6dfb23a816195320bdd (patch)
tree98a52492045c0b59661676ee6289a9419b8a2072 /libre/calibre-libre/calibre-mount-helper
parent4446f2330756577653fd2ebbaf1bef6950720fde (diff)
parentf62179b3bfcd584fa856098cbddb39614b9f8a60 (diff)
downloadabslibre-937c8656ecd59d9800c7d6dfb23a816195320bdd.tar.gz
abslibre-937c8656ecd59d9800c7d6dfb23a816195320bdd.tar.bz2
abslibre-937c8656ecd59d9800c7d6dfb23a816195320bdd.zip
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
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
+