summaryrefslogtreecommitdiffstats
path: root/lava-master/scripts/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lava-master/scripts/setup.sh')
-rwxr-xr-xlava-master/scripts/setup.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh
index 585499e..c00cb02 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/scripts/setup.sh
@@ -1,5 +1,12 @@
#!/bin/bash
+# always reset the lavaserver user, since its password could have been reseted in a "docker build --nocache"
+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 /root/lava-users ];then
for ut in $(ls /root/lava-users)
do