Imported Upstream version 2.5.1
[debian/amanda] / server-src / amcrypt.sh.in
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 AMANDA_HOME=~@CLIENT_LOGIN@
13
14 AM_AESPIPE=@sbindir@/amaespipe
15 AM_PASSPHRASE=$AMANDA_HOME/.am_passphrase
16 PATH=/usr/bin:/usr/local/bin:/sbin:/usr/sbin
17 export PATH
18
19 AESPIPE=`which aespipe`
20
21 if [ $? -ne 0 ] ; then
22         echo "amcrypt: aespipe not found in $PATH" >&2
23         exit 2
24 fi
25
26 if [ ! -x $AESPIPE ] ; then
27         echo "amcrypt: aespipe it's not executable" >&2
28         exit 2
29 fi
30
31 if [ ! -x $AM_AESPIPE ] ; then
32         echo "amcrypt: $AM_AESPIPE not found or it's not executable"  >&2
33         exit 2
34 fi
35
36 $AM_AESPIPE "$@" 3< $AM_PASSPHRASE
37
38 rc=$?
39 exit $rc