From 84137539c0f6ded25b6391fd82334dfd47d47676 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 27 Sep 2015 20:23:58 +0200 Subject: [PATCH] [enh] create db and set password for stupid php --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index f8e8131..7626ab6 100644 --- a/scripts/install +++ b/scripts/install @@ -36,6 +36,11 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/noalyss.conf sed -i "s@NAMETOCHANGE@noalyss@g" ../conf/php-fpm.conf +db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') + +sudo -i -u postgres -c "echo \"$db_pwd\n$db_pwd\" | createuser -P -S -R --createdb noalyss" + +sed -i "s@DATABASE_PASSWORD@$db_pwd@g" ../conf/noalyss.conf finalphpconf=/etc/php5/fpm/pool.d/noalyss.conf sudo cp ../conf/php-fpm.conf $finalphpconf