Prevent failures on non-debian.org hosts
authorPaul Wise <pabs@debian.org>
Fri, 6 Mar 2015 00:12:02 +0000 (08:12 +0800)
committerPaul Wise <pabs@debian.org>
Fri, 6 Mar 2015 00:12:37 +0000 (08:12 +0800)
dsa-nagios-checks/checks/dsa-check-mirrorsync

index b869116..f3bf783 100755 (executable)
@@ -53,7 +53,8 @@ sub usage($$) {
 };
 
 # Work around LWP not being able to verify service certs directly
-$ENV{'HTTPS_CA_DIR'} = '/etc/ssl/ca-debian';
+my $ca_dir = '/etc/ssl/ca-debian';
+$ENV{'HTTPS_CA_DIR'} = $ca_dir if -d $ca_dir;
 
 $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin';
 delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};