From ca5fe9aa968d204da71887b212675a1c995895ad Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 19 Apr 2012 11:17:13 +0200 Subject: [PATCH] Fix bug #1805 cannot specify hostname in ./configure --- bacula/autoconf/configure.in | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 02b17a3426..acbdf2f908 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1264,6 +1264,11 @@ hostname=`uname -n | cut -d '.' -f 1` if test x${hostname} = x ; then hostname="localhost" fi +dnl Make sure hostname is resolved +ping -c 1 $hostname 2>/dev/null 1>/dev/null +if test ! $? = 0; then + hostname="localhost" +fi AC_ARG_WITH(hostname, AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]), [ @@ -2858,16 +2863,6 @@ WIN32= MACOSX= COMPRESS_MANPAGES=yes -hostname=`uname -n | cut -d '.' -f 1` -if test x${hostname} = x ; then - hostname="localhost" -fi -dnl Make sure hostname is resolved -ping -c 1 $hostname 2>/dev/null 1>/dev/null -if test ! $? = 0; then - hostname="localhost" -fi - case "$DISTNAME" in aix) DISTVER=`uname -r` -- 2.39.5