From: Kern Sibbald Date: Thu, 19 Apr 2012 09:17:13 +0000 (+0200) Subject: Fix bug #1805 cannot specify hostname in ./configure X-Git-Tag: Release-5.2.7~49 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a10d78b661335b1d65f12a847a149d8758706b8;p=bacula%2Fbacula Fix bug #1805 cannot specify hostname in ./configure --- 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`