From 581afcb5407281a1a42f985fb88bb10bcc224149 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 20 Jul 2015 11:44:30 +0200 Subject: [PATCH] Recursor: Don't use `hostname -f` on Solaris/SunOS --- pdns/configure-recursor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.47.2