debian: in postinst only generate secret if none exists

This commit is contained in:
Benjamin Dauvergne 2013-09-20 23:12:20 +02:00
parent 4023a55b54
commit e9a2e2f02d
1 changed files with 5 additions and 3 deletions

View File

@ -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"