biiig wrench

This commit is contained in:
Your Name
2025-05-03 22:58:39 +12:00
parent 107034cf7b
commit 340170b248
51 changed files with 347 additions and 395 deletions

View File

@ -1,21 +1,19 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
# START SCRIPT
# The start script is required for all templates.
# It is used to start the service on the server.
# It is called with the path to the server specific env file as an argument.
# Simple Object Storage Start Script
# Creates and starts the container using environment variables.
source "$(dirname "$0")/_common.sh"
check_required_env_vars "CONTAINER_NAME" "VOLUME_NAME" "CONFIG_PATH"
# check volume exists.
if ! docker volume inspect "${VOLUME_NAME}" &>/dev/null; then
die "Docker volume ${VOLUME_NAME} does not exist"
_die "Docker volume ${VOLUME_NAME} does not exist"
fi
# determine port.
command -v jq &> /dev/null || die "jq could not be found, please install it"
[ -f "${CONFIG_PATH}/sos_config.json" ] || die "sos_config.json does not exist"
command -v jq &> /dev/null || _die "jq could not be found, please install it"
[ -f "${CONFIG_PATH}/sos_config.json" ] || _die "sos_config.json does not exist"
PORT=$(jq -r '.port' "${CONFIG_PATH}/sos_config.json")
@ -29,12 +27,12 @@ DOCKER_RUN_CMD="docker run -d \
if ! create_and_start_container "$DOCKER_RUN_CMD" "$CONTAINER_NAME"; then
die "Failed to start container ${CONTAINER_NAME}"
_die "Failed to start container ${CONTAINER_NAME}"
fi
# Check if the container is running
if ! _is_container_running "$CONTAINER_NAME"; then
die "Container ${CONTAINER_NAME} is not running"
_die "Container ${CONTAINER_NAME} is not running"
fi
echo "Container ${CONTAINER_NAME} started"