Don't assume that everyone has a home. Per github issue #23
authorGreg Sabino Mullane <greg@endpoint.com>
Thu, 21 Feb 2013 02:25:49 +0000 (21:25 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Thu, 21 Feb 2013 02:25:49 +0000 (21:25 -0500)
check_postgres.pl

index 041e520cef816a9e208eb841468bd8991caa9dba..9cffd2c9dc31af2b33e3ae79409a90c00338ad14 100755 (executable)
@@ -865,7 +865,7 @@ if (! $opt{'no-check_postgresrc'}) {
     if (-e '.check_postgresrc') {
         $rcfile = '.check_postgresrc';
     }
-    elsif (-e "$ENV{HOME}/.check_postgresrc") {
+    elsif (exists $ENV{HOME} and -e "$ENV{HOME}/.check_postgresrc") {
         $rcfile = "$ENV{HOME}/.check_postgresrc";
     }
     elsif (-e '/etc/check_postgresrc') {