#/bin/bash

main()
{
	# start postgres
	service postgresql start

	# wait for postres to start
	while ! pg_isready; do sleep 1; done;


	# setup connections and env for turbod and prepd
	export USER=root;
	cd /turbo
	source ./set_env_vars 

	# start trubo
	cd /tmp
	/turbo/bin/turbod.exe  > /tmp/turbod.log 2>&1 &

	# start prepd
	/turbo/bin/prepd.exe > /tmp/prepd.log 2>&1 

}

main "$@" 
