truecrypt_getdevices.sh
author ft
Mon, 10 Nov 2014 14:45:01 +0100
changeset 1 f7b8f096b359
permissions -rwxr-xr-x
upaded package with latest source
     1 #!/bin/sh
     2 
     3 # ------------------------------------------------------------
     4 # opensecurity package file
     5 #
     6 # Autor: X-Net Services GmbH <office@x-net.at>
     7 #
     8 # Copyright 2013-2014 X-Net and AIT Austrian Institute of Technology
     9 #
    10 #
    11 #     X-Net Technologies GmbH
    12 #     Elisabethstrasse 1
    13 #     4020 Linz
    14 #     AUSTRIA
    15 #     https://www.x-net.at
    16 #
    17 #     AIT Austrian Institute of Technology
    18 #     Donau City Strasse 1
    19 #     1220 Wien
    20 #     AUSTRIA
    21 #     http://www.ait.ac.at
    22 #
    23 #
    24 # Licensed under the Apache License, Version 2.0 (the "License");
    25 # you may not use this file except in compliance with the License.
    26 # You may obtain a copy of the License at
    27 #
    28 #    http://www.apache.org/licenses/LICENSE-2.0
    29 #
    30 # Unless required by applicable law or agreed to in writing, software
    31 # distributed under the License is distributed on an "AS IS" BASIS,
    32 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    33 # See the License for the specific language governing permissions and
    34 # limitations under the License.
    35 # ------------------------------------------------------------
    36 
    37 BASEDIR="$(dirname $0)"
    38 
    39 if [ -r "$BASEDIR/truecrypt_config.cfg" ]
    40 then
    41 	. "$BASEDIR/truecrypt_config.cfg"
    42 else
    43 	echo "truecrypt_config.cfg not found" >&2
    44 	exit 1
    45 fi
    46 
    47 devicelist="$($tc_cmd -l)"
    48 result="$?"
    49 
    50 if [ "$result" != "0" ]
    51 then
    52 	exit 1
    53 fi
    54 
    55 # can't do this on the original command because of /bin/sh -> dash -> no PIPESTATUS -.-
    56 devicelist=$(echo $devicelist | awk '{ print $2}')
    57 
    58 echo "$devicelist"
    59 exit 0