Some basics working (squashkiwi, dropshell-agent).

This commit is contained in:
Your Name
2025-05-03 23:34:05 +12:00
parent 3d9b1fa6d2
commit 77c7315b0b
50 changed files with 192 additions and 225 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "LOCAL_DATA_FOLDER"
_check_required_env_vars "LOCAL_DATA_FOLDER"
# Nginx Example Backup Script
# hot backup is fine for nginx website content.

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "LOCAL_DATA_FOLDER" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "CONTAINER_NAME"
_check_required_env_vars "LOCAL_DATA_FOLDER" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "CONTAINER_NAME"
# Nginx Example Install Script

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "CONTAINER_NAME"
_check_required_env_vars "CONTAINER_NAME"
# Nginx Example Logs Script

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "LOCAL_DATA_FOLDER" "CONTAINER_NAME"
_check_required_env_vars "LOCAL_DATA_FOLDER" "CONTAINER_NAME"
# Nginx Example Nuke Script
# Removes container and local data folder.

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "HOST_PORT"
_check_required_env_vars "HOST_PORT"
# Nginx Example Ports Script

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "LOCAL_DATA_FOLDER"
_check_required_env_vars "LOCAL_DATA_FOLDER"
# Nginx Example Restore Script

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "CONTAINER_NAME" "LOCAL_DATA_FOLDER" "HOST_PORT" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
_check_required_env_vars "CONTAINER_NAME" "LOCAL_DATA_FOLDER" "HOST_PORT" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
# START SCRIPT
# The start script is required for all templates.
@ -8,7 +8,7 @@ check_required_env_vars "CONTAINER_NAME" "LOCAL_DATA_FOLDER" "HOST_PORT" "IMAGE_
# It is called with the path to the server specific env file as an argument.
[ -d "${LOCAL_DATA_FOLDER}" ] || die "Local data folder ${LOCAL_DATA_FOLDER} does not exist."
[ -d "${LOCAL_DATA_FOLDER}" ] || _die "Local data folder ${LOCAL_DATA_FOLDER} does not exist."
DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
@ -19,12 +19,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"

View File

@ -1,13 +1,13 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "CONTAINER_NAME"
_check_required_env_vars "CONTAINER_NAME"
# STATUS SCRIPT
# The status script is OPTIONAL.
# It is used to return the status of the service (0 is healthy, 1 is unhealthy).
# check if the service is running
_is_container_running $CONTAINER_NAME || die "Service is not running - did not find container $CONTAINER_NAME."
_is_container_running $CONTAINER_NAME || _die "Service is not running - did not find container $CONTAINER_NAME."
echo "Service is healthy"
exit 0

View File

@ -1,7 +1,7 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "CONTAINER_NAME"
_check_required_env_vars "CONTAINER_NAME"
_stop_container $CONTAINER_NAME || die "Failed to stop container ${CONTAINER_NAME}"
_stop_container $CONTAINER_NAME || _die "Failed to stop container ${CONTAINER_NAME}"
echo "Container ${CONTAINER_NAME} stopped"

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "${AGENT_PATH}/_common.sh"
check_required_env_vars "CONTAINER_NAME"
_check_required_env_vars "CONTAINER_NAME"
# Nginx Example Uninstall Script