tUndertaker: add udisks:/// - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit e0db6318fef6babe4eb95d967b32db244bbc9cd8
DIR parent 55a14a95d683f80d8149e62bbb906d9a80803300
HTML Author: boyska <piuttosto@logorroici.org>
Date: Wed, 16 Nov 2011 23:30:35 +0100
Undertaker: add udisks:///
Diffstat:
M src/undertaker | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)
---
DIR diff --git a/src/undertaker b/src/undertaker
t@@ -100,6 +100,27 @@ function undertaker_scheme() {
fi
done
;;
+ udisks)
+ #It implements automounting using udisks; udisks is a (recently)
+ #new technology, so we can't rely on it being present
+ if ! which udisks &> /dev/null; then
+ error 'udisks not found'
+ exit 64
+ fi
+ while true; do
+ device=`udisks --monitor|egrep '/sd[a-z][0-9]' -o -m1`
+ device=/dev$device
+ udisks --mount $device
+ ###get mountpoint for device
+ mountpoint=`egrep "^${device} " /etc/mtab|cut -d ' ' -f2`
+ undertaker_scheme ${print_path[@]} file ${mountpoint}/${keypath}
+ ret=$?
+ udisks --unmount $device
+ if [[ $ret == 0 ]]; then
+ return 0
+ fi
+ done
+ ;;
*)
if ! which undertaker-$scheme &> /dev/null; then
error "url protocol not recognized: $scheme"