summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cozy.install11
1 files changed, 8 insertions, 3 deletions
diff --git a/cozy.install b/cozy.install
index c933f01493f4..99c59ae92831 100644
--- a/cozy.install
+++ b/cozy.install
@@ -51,9 +51,14 @@ post_install() {
chown -hR cozy /etc/cozy
if [ ! -f /etc/cozy/couchdb.login ]; then
- msg 'Generating CouchDB tokens...'
- pwgen -1 > /etc/cozy/couchdb.login && \
- pwgen -1 >> /etc/cozy/couchdb.login
+ if [ ! -f /tmp/couchdb.login ]; then
+ msg 'Found tokens from previous installation'
+ mv /tmp/couchdb.login /etc/cozy/couchdb.login
+ else
+ msg 'Generating CouchDB tokens...'
+ pwgen -1 > /etc/cozy/couchdb.login && \
+ pwgen -1 >> /etc/cozy/couchdb.login
+ fi
msg 'Enabling CouchDB'
systemctl enable couchdb
systemctl restart couchdb