X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=rewrite-config.PL;h=6167c5ee009fbcf1daaf2dfa7834d2cb0d4aaab0;hb=a5edf5011a599108311bb2569d4bfffd6a222ef3;hp=69b070a687208b505181173ec2daf70dd541305a;hpb=2fafa1424b8d4d31d68a2868bd237541c870a4ed;p=koha.git diff --git a/rewrite-config.PL b/rewrite-config.PL index 69b070a687..6167c5ee00 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -64,7 +64,11 @@ $myhost = hostname(); $mydomain = $myhost; $mydomain =~ s/^.*?\.//; # This is set here to rescue systems with broken DNS -$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?"; +if ( !gethostbyname( $myhost || 'localhost' ) ) { + die 'Could not get the IP address of ' . ( $myhost || 'localhost' ) . ', DNS fault?'; +} + +$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa( scalar gethostbyname( $myhost||'localhost' ) ); $prefix = $ENV{'INSTALL_BASE'} || "/usr"; # These are our configuration guesses