From 05497a558cabaa40ffec53c79250374c59a90f7a Mon Sep 17 00:00:00 2001 From: Mike Cardwell Date: Tue, 27 Sep 2011 14:21:11 +0100 Subject: [PATCH] Set the HOME environment variable to match the homedir of the user running the script, so that the .gnupg folder can be found easily. --- gpgit.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpgit.pl b/gpgit.pl index 19b9a2e..d59ddb6 100755 --- a/gpgit.pl +++ b/gpgit.pl @@ -49,6 +49,9 @@ use MIME::Parser; die "Missing recipients\n" unless @recipients; } +## Set the home environment variable from the user running the script + $ENV{HOME} = (getpwuid($>))[7]; + ## Object for GPG encryption my $gpg = new Mail::GnuPG();