ft@1: #!/bin/sh ft@1: ft@27: # ------------------------------------------------------------ ft@27: # opensecurity package file ft@27: # ft@27: # Autor: X-Net Services GmbH ft@27: # ft@27: # Copyright 2013-2014 X-Net and AIT Austrian Institute of Technology ft@27: # ft@27: # ft@27: # X-Net Technologies GmbH ft@27: # Elisabethstrasse 1 ft@27: # 4020 Linz ft@27: # AUSTRIA ft@27: # https://www.x-net.at ft@27: # ft@27: # AIT Austrian Institute of Technology ft@27: # Donau City Strasse 1 ft@27: # 1220 Wien ft@27: # AUSTRIA ft@27: # http://www.ait.ac.at ft@27: # ft@27: # ft@27: # Licensed under the Apache License, Version 2.0 (the "License"); ft@27: # you may not use this file except in compliance with the License. ft@27: # You may obtain a copy of the License at ft@27: # ft@27: # http://www.apache.org/licenses/LICENSE-2.0 ft@27: # ft@27: # Unless required by applicable law or agreed to in writing, software ft@27: # distributed under the License is distributed on an "AS IS" BASIS, ft@27: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ft@27: # See the License for the specific language governing permissions and ft@27: # limitations under the License. ft@27: # ------------------------------------------------------------ ft@27: ft@1: BASEDIR="$(dirname $0)" ft@1: DEVICE="$1" ft@1: MOUNTPOINT="$2" ft@1: PASSWORD="$3" ft@1: KEYFILE="$4" ft@1: ft@1: if [ -r "$BASEDIR/truecrypt_config.cfg" ] ft@1: then ft@1: . "$BASEDIR/truecrypt_config.cfg" ft@1: else ft@1: echo "truecrypt_config.cfg not found" >&2 ft@1: exit 1 ft@1: fi ft@1: ft@1: if [ -z "$KEYFILE" ] ft@1: then ft@1: message="$($tc_cmd --non-interactive "$DEVICE" "$MOUNTPOINT" -p "$PASSWORD")" ft@1: result="$?" ft@1: else ft@1: message="$($tc_cmd --non-interactive "$DEVICE" "$MOUNTPOINT" -p "$PASSWORD" -k "$KEYFILE")" ft@1: result="$?" ft@1: fi ft@1: ft@1: ft@1: ft@1: if [ "$result" != "0" ] ft@1: then ft@1: exit 1 ft@1: fi ft@1: ft@1: echo "$message" ft@1: exit 0