[Fusionforge-commits] r13734 - trunk/src/install

Christian Bayle cbayle at fusionforge.org
Fri Jul 8 16:51:56 CEST 2011


Author: cbayle
Date: 2011-07-08 16:51:56 +0200 (Fri, 08 Jul 2011)
New Revision: 13734

Modified:
   trunk/src/install/install3
Log:
Add dropdbifexists function


Modified: trunk/src/install/install3
===================================================================
--- trunk/src/install/install3	2011-07-08 14:40:45 UTC (rev 13733)
+++ trunk/src/install/install3	2011-07-08 14:51:56 UTC (rev 13734)
@@ -187,6 +187,20 @@
 	msg green " * Saving installation log in /tmp/gforge-import.log"
 }
 
+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 "$database" ]
+	then
+        	echo "Forge database name not found"
+        	exit 1
+	else
+		echo "Droping database $database"
+		su - postgres -c "dropdb -e $database"
+	fi
+}
+
 installandrundb()
 {
 	# USING $gforge_user, $gforge_db, $pghba, $fusionforge_src_dir, $fusionforge_etc_dir, $tsearch, $pgservice, $STDIN, $STDOUT;




More information about the Fusionforge-commits mailing list