From 0f92922979ec1f52c580079a4a49a7dc84af4ca1 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 22 Dec 2012 02:49:14 -0800 Subject: Sat Dec 22 02:47:27 PST 2012 --- libre/calibre-libre/calibre-mount-helper | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libre/calibre-libre/calibre-mount-helper (limited to 'libre/calibre-libre/calibre-mount-helper') 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 + +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 + -- cgit v1.2.3-54-g00ecf