#!/bin/bash

case $1 in
  postgres)
    chown -R postgres:postgres /data
    shift
    sudo -u postgres -H EXTERNAL_IP=$EXTERNAL_IP PORT=$PORT DISCOVERD=$DISCOVERD /bin/flynn-postgres $*
    ;;
  api)
    shift
    /bin/flynn-postgres-api $*
    ;;
  *)
    echo "Usage: $0 {postgres|api}"
    exit 2
    ;;
esac

#!/bin/bash

case $1 in
  postgres)
    chown -R postgres:postgres /data
    shift
    exec sudo -u postgres -H EXTERNAL_IP=$EXTERNAL_IP PORT=$PORT DISCOVERD=$DISCOVERD /bin/flynn-postgres $*
    ;;
  api)
    shift
    exec /bin/flynn-postgres-api $*
    ;;
  *)
    echo "Usage: $0 {postgres|api}"
    exit 2
    ;;
esac

Use exec in wrapper to fix SIGTERM handling.
Use exec in wrapper to fix SIGTERM handling.

Signed-off-by: Michael Elsdörfer <17b9e1c64588c7fa6419b4d29dc1f4426279ba01@elsdoerfer.com>
