[ckan-changes] commit/ckan-debs-public: jame... at okfn.org: Removing the need for a password when creating the config file

Bitbucket commits-noreply at bitbucket.org
Mon Jun 27 13:13:55 UTC 2011


1 new changeset in ckan-debs-public:

http://bitbucket.org/okfn/ckan-debs-public/changeset/a16b22a57bfa/
changeset:   a16b22a57bfa
user:        jame... at okfn.org
date:        2011-06-27 15:13:44
summary:     Removing the need for a password when creating the config file
affected #:  1 file (76 bytes)

--- a/ckan-common/usr/lib/ckan/common.sh	Mon Jun 27 11:49:47 2011 +0100
+++ b/ckan-common/usr/lib/ckan/common.sh	Mon Jun 27 14:13:44 2011 +0100
@@ -90,16 +90,16 @@
 
 ckan_create_config_file () {
     local INSTANCE password
-    if [ "X$1" = "X" ] || [ "X$2" = "X" ] ; then
-        echo "ERROR: call the function create_config_file function with an INSTANCE name, and a password for postgresql e.g." 
-        echo "       dgu 1U923hjkh8"
-        echo "       You can generate a password like this: "
-        echo "           < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c10"
+    if [ "X$1" = "X" ] ; then
+        echo "ERROR: call the function create_config_file function with an INSTANCE name e.g." 
+        echo "       dgu"
         exit 1
     else
         INSTANCE=$1
-        password=$2
-        mv /etc/ckan/${INSTANCE}/${INSTANCE}.ini "/etc/ckan/${INSTANCE}/${INSTANCE}.ini.`date +%F_%T`.bak"
+        # Create an install settings file if it doesn't exist
+        if [ -f /etc/ckan/${INSTANCE}/${INSTANCE}.ini ] ; then
+            mv /etc/ckan/${INSTANCE}/${INSTANCE}.ini "/etc/ckan/${INSTANCE}/${INSTANCE}.ini.`date +%F_%T`.bak"
+        fi
         paster make-config ckan /etc/ckan/${INSTANCE}/${INSTANCE}.ini
         sed -e "s,^\(email_to\)[ =].*,\1 = root," \
             -e "s,^\(error_email_from\)[ =].*,\1 = ckan-${INSTANCE}@`hostname`," \

Repository URL: https://bitbucket.org/okfn/ckan-debs-public/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list