[Fusionforge-commits] r12177 - branches/Branch_5_1/src

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Feb 7 15:53:12 CET 2011


Author: lolando
Date: 2011-02-07 15:53:11 +0100 (Mon, 07 Feb 2011)
New Revision: 12177

Modified:
   branches/Branch_5_1/src/setup
Log:
Merged from Evolvis: pick the first response out of what hostname(1) returns

Modified: branches/Branch_5_1/src/setup
===================================================================
--- branches/Branch_5_1/src/setup	2011-02-07 14:16:55 UTC (rev 12176)
+++ branches/Branch_5_1/src/setup	2011-02-07 14:53:11 UTC (rev 12177)
@@ -10,18 +10,25 @@
 	read $1
 }
 
+hostname_oneword() {
+	hostname "$@" | while read first rest; do
+		printf '%s' "$first"
+		break
+	done
+}
+
 computedefault(){
 	echo "Calculating defaults"
 	# This is used to make a default working gforge.conf
 	DEFAULTsystem_name=MyForge
-	DEFAULTdomain_name=`hostname -f`
+	DEFAULTdomain_name=`hostname_oneword -f`
 	DEFAULTserver_admin=webmaster@$DEFAULTdomain_name
 	DEFAULTdb_host=
 	DEFAULTdb_port=
 	DEFAULTdb_name=gforge
 	DEFAULTdb_user=gforge
 	DEFAULTdb_password=$(dd if=/dev/urandom count=1 bs=8 2> /dev/null | md5sum | cut -b1-8)
-	DEFAULTip_address=`hostname -i | cut -d' ' -f1`
+	DEFAULTip_address=`hostname_oneword -i`
 	DEFAULTscm_host=scm.$DEFAULTdomain_name
 	DEFAULTshell_host=shell.$DEFAULTdomain_name
 	DEFAULTusers_host=users.$DEFAULTdomain_name




More information about the Fusionforge-commits mailing list