#!/bin/bash 

configure_postgres() {
  while ! status presto-server | grep -q running 2>/dev/null
  do
  	sleep 1
  done
  aws s3 cp s3://ty-emr/XRR/presto/pg1.properties ~
  aws s3 cp s3://ty-emr/XRR/presto/pg2.properties ~
  sudo mv ~/*.properties /etc/presto/conf/catalog
  sudo restart presto-server
}

configure_postgres &
