#!/bin/bash # PORT SCRIPT # The port script is OPTIONAL. # It is used to return the ports used by the service. # It is called with the path to the server specific env file as an argument. source "$(dirname "$0")/_common.sh" # Required environment variables # check_required_env_vars "HOST_PORT" # check if jq is installed if ! command -v jq &> /dev/null; then die "jq could not be found, please install it" fi # check if sos_config.json exists if [ ! -f "${CONFIG_PATH}/sos_config.json" ]; then die "sos_config.json does not exist" fi # extract port from sos_config.json PORT=$(jq -r '.port' "${CONFIG_PATH}/sos_config.json") echo $PORT