fix for bug 2528: installation fails with confusing error message
This makes the dns check happen earlier, and fail humanely if there is a problem. Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
6e53a31357
commit
4712745527
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue