diff --git a/packages/express/ami/ami-config.sh b/packages/express/ami/ami-config.sh index 131a4a7f..ee4a971e 100644 --- a/packages/express/ami/ami-config.sh +++ b/packages/express/ami/ami-config.sh @@ -5,8 +5,20 @@ MYSQLROOTPWD="${1:-root}" f () { cd /root curl -s https://raw.githubusercontent.com/openemr/openemr-devops/master/packages/lightsail/launch.sh | bash -s -- -s 0 - # wait for MySQL to spin up - sleep 15 + + # wait a while for services to build + until docker container ls | grep openemr/openemr >& /dev/null + do + echo "waiting for container start..." + sleep 5 + done + + until docker top $(docker ps | grep _openemr | cut -f 1 -d " ") | grep httpd &> /dev/null + do + echo "waiting for service start..." + sleep 5 + done + docker exec $(docker ps | grep mysql | cut -f 1 -d " ") mysql --password="$MYSQLROOTPWD" -e "update openemr.users set active=0 where id=1;" cp openemr-devops/packages/express/ami/ami-rekey.sh /etc/init.d/ami-rekey update-rc.d ami-rekey defaults