fall back to the hostname -f if the hostname -A returns empty string without error...
authorJoni Hahkala <joni.hahkala@cern.ch>
Mon, 14 May 2012 22:37:09 +0000 (22:37 +0000)
committerJoni Hahkala <joni.hahkala@cern.ch>
Mon, 14 May 2012 22:37:09 +0000 (22:37 +0000)
bin/generate-test-certificates.sh

index 854e98e..207edd1 100755 (executable)
@@ -1226,6 +1226,9 @@ openssl version
 hostname_space=`hostname -A 2>/dev/null || hostname -f`
 #remove trailing space, take fist one if there are aliases
 hostname_full=`echo $hostname_space | awk '{print $1}'`
+if [ x${hostname_full} == "x" ]; then
+hostname_full=`hostname -f`
+
 echo host name is [$hostname_full]
 
 export DNS_HOSTNAME=DNS:$hostname_full