Imported Upstream version 2.6.0
[debian/amanda] / common-src / amcrypt.sh
1 #!@SHELL@
2 #
3 # Original wrapper by Paul Bijnens
4 #
5 # worked by Stefan G. Weichinger
6 # to enable gpg-encrypted dumps via aespipe
7 # also worked by Matthieu Lochegnies for server-side encryption
8
9 prefix="@prefix@"
10 exec_prefix="@exec_prefix@"
11 sbindir="@sbindir@"
12 amlibexecdir="@amlibexecdir@"
13 . "${amlibexecdir}/amanda-sh-lib.sh"
14
15 # add sbin and ucb dirs, as well as csw (blastwave)
16 PATH="$PATH:/usr/sbin:/sbin:/usr/ucb:/opt/csw/bin"
17 export PATH
18
19 AMANDA_HOME=~@CLIENT_LOGIN@
20 AM_AESPIPE=@sbindir@/amaespipe
21 AM_PASSPHRASE=$AMANDA_HOME/.am_passphrase
22
23 AESPIPE=`which aespipe`
24
25 if [ $? -ne 0 ] ; then
26         echo `_ '%s: %s was not found in %s' "$0" "aespipe" "$PATH"` >&2
27         exit 2
28 fi
29
30 if [ ! -x $AESPIPE ] ; then
31         echo `_ '%s: %s is not executable' "$0" "aespipe"` >&2
32         exit 2
33 fi
34
35 if [ ! -x $AM_AESPIPE ] ; then
36         echo `_ '%s: %s was not found' "$0" "$AM_AESPIPE"` >&2
37         exit 2
38 fi
39 if [ ! -x $AM_AESPIPE ] ; then
40         echo `_ '%s: %s is not executable' "$0" "$AM_AESPIPE"` >&2
41         exit 2
42 fi
43
44 $AM_AESPIPE "$@" 3< $AM_PASSPHRASE
45
46 rc=$?
47 exit $rc