diff --git a/lib/functions.sh b/lib/functions.sh index 6dc86bf..3760a9d 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -358,10 +358,25 @@ start_service() { SERVICE="$1" COMMAND="$2" RETRY="$3" + local DEPENDS="" # Start /federated/apps/SERVICE with output to /dev/null echo -ne "* Starting $SERVICE.." + if [ -e /federated/services/$SERVICE/service ]; then + . /federated/services/$SERVICE/services + if [ -n "$DEPENDS" ]; then + echo "Ensuring dependencies are up and running" + local dep + for dep in $DEPENDS; do + echo "* ... $dep" + if ! /federated/bin/check $dep; then + /federated/bin/fix $dep + fi + done + fi + fi + if [ $DEBUG ]; then # Start /federated/apps/SERVICE with output to console for debug docker compose -f /federated/apps/$SERVICE/docker-compose.yml -p $SERVICE up