From: Pieter Lexis Date: Mon, 20 Jul 2015 09:44:30 +0000 (+0200) Subject: Recursor: Don't use `hostname -f` on Solaris/SunOS X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~43^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=581afcb5407281a1a42f985fb88bb10bcc224149;p=thirdparty%2Fpdns.git Recursor: Don't use `hostname -f` on Solaris/SunOS --- diff --git a/pdns/configure-recursor b/pdns/configure-recursor index 802f3b9ede..a2dc30723f 100755 --- a/pdns/configure-recursor +++ b/pdns/configure-recursor @@ -26,8 +26,16 @@ CF_PIE="" LD_PIE="" CF_FORTIFY="" CF_STACK="" -BUILD_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)" +BUILD_USER="$(id -u -n)" +case $(uname) in + SunOS) + BUILD_HOST="${BUILD_USER}@$(hostname).$(domainname)" ;; + *) + BUILD_HOST="${BUILD_USER}@$(hostname -f || echo 'localhost')" ;; +esac + +perl -p -i -e '/#define BUILD_HOST/d' config.h cat >> config.h << EOF #define BUILD_HOST "${BUILD_HOST}" EOF