[Fusionforge-commits] r11090 - trunk/src/debian/dsf-in

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Oct 20 22:04:11 CEST 2010


Author: lolando
Date: 2010-10-20 22:04:11 +0200 (Wed, 20 Oct 2010)
New Revision: 11090

Modified:
   trunk/src/debian/dsf-in/common.postinst
Log:
Use the db_password from Debconf, if any

Modified: trunk/src/debian/dsf-in/common.postinst
===================================================================
--- trunk/src/debian/dsf-in/common.postinst	2010-10-20 19:55:59 UTC (rev 11089)
+++ trunk/src/debian/dsf-in/common.postinst	2010-10-20 20:04:11 UTC (rev 11090)
@@ -58,10 +58,14 @@
 	    fi
 	    if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
 		t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
-		if [ -c /dev/urandom ]; then  # ...using /dev/urandom when possible
-		    pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
-		else		# ...or something else if need be.
-		    pw=$(date +"%s:%N" | md5sum | cut -c-32)
+		db_get @PACKAGE@/shared/db_password || true
+		pw=$RET
+		if [ "$pw" = "" ] ; then
+		    if [ -c /dev/urandom ]; then  # ...using /dev/urandom when possible
+			pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
+		    else		# ...or something else if need be.
+			pw=$(date +"%s:%N" | md5sum | cut -c-32)
+		    fi
 		fi
 
 		cat > $t <<EOF




More information about the Fusionforge-commits mailing list