summaryrefslogtreecommitdiff
path: root/libre/calibre-libre/calibre-mount-helper
blob: 00cac42707572abdfd375ba64e8a3434a7b88be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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