From e9a2e2f02d2023e197b6d5937fe7ac21487182f2 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 20 Sep 2013 23:12:20 +0200 Subject: [PATCH] debian: in postinst only generate secret if none exists --- debian/wcsinstd.postinst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/wcsinstd.postinst b/debian/wcsinstd.postinst index 3761984..d2097cf 100644 --- a/debian/wcsinstd.postinst +++ b/debian/wcsinstd.postinst @@ -32,9 +32,11 @@ case "$1" in chown $WCSINSTD_USER:$WCSINSTD_GROUP $WCSINSTD_HOME/media $WCSINSTD_HOME/templates # echo -n "Initializing sqlite database.." # $WCSINSTD_INIT manage syncdb --migrate - echo -n "Generating secret.." - dd if=/dev/random ibs=1 count=32 2>/dev/null >/etc/$NAME/secret - echo "..done" + if [ ! -f /etc/$NAME/secret ]; then + echo -n "Generating secret.." + dd if=/dev/random ibs=1 count=32 2>/dev/null >/etc/$NAME/secret + echo "..done" + fi echo -n "Generating static files.." $WCSINSTD_INIT manage collectstatic --noinput --link echo "..done"