truecrypt_scripts/truecrypt_getdevices.sh
author ft
Tue, 09 Sep 2014 09:19:17 +0200
changeset 25 25581dcb9e62
parent 0 35acc83f4749
child 27 a8c8d86b8501
permissions -rwxr-xr-x
changed information notifications (no popup anymore)
ft@1
     1
#!/bin/sh
ft@0
     2
ft@1
     3
BASEDIR="$(dirname $0)"
ft@1
     4
ft@1
     5
if [ -r "$BASEDIR/truecrypt_config.cfg" ]
ft@0
     6
then
ft@1
     7
	. "$BASEDIR/truecrypt_config.cfg"
ft@0
     8
else
ft@1
     9
	echo "truecrypt_config.cfg not found" >&2
ft@0
    10
	exit 1
ft@0
    11
fi
ft@0
    12
ft@1
    13
devicelist="$($tc_cmd -l)"
ft@0
    14
result="$?"
ft@1
    15
ft@0
    16
if [ "$result" != "0" ]
ft@0
    17
then
ft@0
    18
	exit 1
ft@0
    19
fi
ft@0
    20
ft@1
    21
# can't do this on the original command because of /bin/sh -> dash -> no PIPESTATUS -.-
ft@1
    22
devicelist=$(echo $devicelist | awk '{ print $2}')
ft@1
    23
ft@0
    24
echo "$devicelist"
ft@0
    25
exit 0