#!/bin/sh

tempfile=`mktemp --tmpdir=/tmp`
printf "%s" $2 | ecryptfs-unwrap-passphrase /var/www/keys/$1

if [ $? -eq 0 ] ;
then
	printf "%s" $2 | ecryptfs-unwrap-passphrase /var/www/keys/$1 | tail -n 1 > $tempfile
	cat $tempfile
	rm $tempfile
	exit 0
else
	exit 1
fi

