From 090fea911d11f316031eb2f8c3401ec49b33ea65 Mon Sep 17 00:00:00 2001 From: Thomas Merkel Date: Mon, 11 Aug 2014 23:09:49 +0200 Subject: [PATCH] sync mysql data and create user --- copy/var/zoneinit/includes/50-kumquat.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/copy/var/zoneinit/includes/50-kumquat.sh b/copy/var/zoneinit/includes/50-kumquat.sh index b26f658..08e4dbe 100644 --- a/copy/var/zoneinit/includes/50-kumquat.sh +++ b/copy/var/zoneinit/includes/50-kumquat.sh @@ -11,6 +11,9 @@ mdata-put mysql_kumquat_pw "${MYSQL_KUMQUAT}" ALLOWED_HOST=$(hostname) SECRET_KEY=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-100}) +ADMIN_KUMQUAT=${ADMIN_KUMQUAT:-$(mdata-get kumquat_admin 2>/dev/null)} || \ +ADMIN_KUMQUAT=$(od -An -N8 -x /dev/random | head -1 | tr -d ' '); + # check if database exists already if [ -d /var/mysql/kumquat ]; then echo 'Database already exists, maybe some migration script will run in the future.' @@ -41,7 +44,7 @@ cat >> /opt/kumquat/kumquat_web/settings.py <