summaryrefslogtreecommitdiffstats
path: root/lava-master/entrypoint.d/01_setup.sh
diff options
context:
space:
mode:
authorKevin Hilman <khilman@baylibre.com>2020-06-20 12:15:55 -0700
committerGitHub <noreply@github.com>2020-06-20 12:15:55 -0700
commitb57379c6b204870a568ccc7adcad1712e715a536 (patch)
treed566dac6b4ba30d0d66f0e4cd7ab3a5973812253 /lava-master/entrypoint.d/01_setup.sh
parent9596a7d56f8e4b6653ae1735075b3fc95b268fe9 (diff)
parent9918419127bbace972725ced88984ad2129ae5cb (diff)
Merge pull request #118 from montjoie/support_2020.05
Support 2020.05
Diffstat (limited to 'lava-master/entrypoint.d/01_setup.sh')
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/lava-master/entrypoint.d/01_setup.sh b/lava-master/entrypoint.d/01_setup.sh
index 5e437ef..53db47e 100755
--- a/lava-master/entrypoint.d/01_setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -5,7 +5,13 @@ if [ ! -e /root/pg_lava_password ];then
< /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
fi
sudo -u postgres psql -c "ALTER USER lavaserver WITH PASSWORD '$(cat /root/pg_lava_password)';" || exit $?
-sed -i "s,^LAVA_DB_PASSWORD=.*,LAVA_DB_PASSWORD='$(cat /root/pg_lava_password)'," /etc/lava-server/instance.conf || exit $?
+if [ -e /etc/lava-server/instance.conf ];then
+ # pre 2020.05
+ sed -i "s,^LAVA_DB_PASSWORD=.*,LAVA_DB_PASSWORD='$(cat /root/pg_lava_password)'," /etc/lava-server/instance.conf || exit $?
+else
+ # 2020.05+
+ sed -i "s,PASSWORD:.*,PASSWORD: '$(cat /root/pg_lava_password)'," /etc/lava-server/settings.d/00-database.yaml || exit $?
+fi
if [ -e /root/backup/db_lavaserver.gz ];then
gunzip /root/backup/db_lavaserver.gz || exit $?