[Fusionforge-commits] r13805 - in trunk/src: . install

Christian Bayle cbayle at fusionforge.org
Sun Jul 17 22:26:07 CEST 2011


Author: cbayle
Date: 2011-07-17 22:26:07 +0200 (Sun, 17 Jul 2011)
New Revision: 13805

Modified:
   trunk/src/install-ng
   trunk/src/install/install3
Log:
Give a db name for when Forge database name not found


Modified: trunk/src/install/install3
===================================================================
--- trunk/src/install/install3	2011-07-17 20:15:19 UTC (rev 13804)
+++ trunk/src/install/install3	2011-07-17 20:26:07 UTC (rev 13805)
@@ -189,16 +189,25 @@
 
 dropdbifexists()
 {
-	export PATH=$PATH:/usr/share/gforge/bin/:/usr/share/gforge/utils:/opt/gforge/utils
-	database=`FUSIONFORGE_NO_PLUGINS=true forge_get_config database_name`
+	if [ -z "$1" ]
+	then
+		export PATH=$PATH:/usr/share/gforge/bin/:/usr/share/gforge/utils:/opt/gforge/utils
+		database=`FUSIONFORGE_NO_PLUGINS=true forge_get_config database_name`
+	else
+		database=$1
+	fi
 	if [ -z "$database" ]
 	then
         	echo "Forge database name not found"
-        	exit 1
+		find_psql_init
+		$pgservice stop
+		$pgservice start
 	else
 		find_psql_init
 		$pgservice stop
+		sleep 5
 		$pgservice start
+		sleep 5
 		echo "Droping database $database"
 		su - postgres -c "dropdb -e $database"
 	fi

Modified: trunk/src/install-ng
===================================================================
--- trunk/src/install-ng	2011-07-17 20:15:19 UTC (rev 13804)
+++ trunk/src/install-ng	2011-07-17 20:26:07 UTC (rev 13805)
@@ -75,7 +75,7 @@
 then
 	echo "Reinit the database"
 	rm -f /etc/gforge/install_completed
-	dropdbifexists
+	dropdbifexists $FFORGE_DB
 fi
 
 if [ -d "/opt/gforge" ]




More information about the Fusionforge-commits mailing list