summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrendan Abolivier2016-03-14 20:39:35 +0100
committerBrendan Abolivier2016-03-14 20:39:35 +0100
commitb43f83a1fa1c4ae8622940ecf04e374e8f89d8e2 (patch)
tree416e46150b3b6d6f1f97ffeea988c518fde57701
parent0d68ca0e28783c10027af7c8dda6671454da9fdb (diff)
downloadaur-b43f83a1fa1c4ae8622940ecf04e374e8f89d8e2.tar.gz
Fixed migration
-rw-r--r--cozy.install11
1 files changed, 8 insertions, 3 deletions
diff --git a/cozy.install b/cozy.install
index c933f01493f..99c59ae9283 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