fix binding

This commit is contained in:
ALinuxNinja 2017-04-27 19:00:19 -04:00
parent 6773d51b27
commit 2796c1c7e5

View File

@ -29,13 +29,19 @@ sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/username.*/username: $RABBITMQ_DEFAULT_U
sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/password.*/password: $RABBITMQ_DEFAULT_PASS/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
## Clean Up
rm -rf /opt/postal/tmp/pids/*
## Initialize DB
echo "== Waiting for MySQL to start up =="
while ! mysqladmin ping -h mysql --silent; do
sleep 1
done
if [[ $(mysql -h mysql -uroot -p$MYSQL_ROOT_PASSWORD -s --skip-column-names -e "SELECT COUNT(DISTINCT table_name) FROM information_schema.columns WHERE table_schema = 'postal'") == 0 ]]; then
/opt/postal/bin/postal initialize
else
/opt/postal/bin/postal upgrade
fi
## Run
/opt/postal/bin/postal run