diff --git a/src/service_runner.cpp b/src/service_runner.cpp index fc7e6a9..601f667 100644 --- a/src/service_runner.cpp +++ b/src/service_runner.cpp @@ -158,7 +158,7 @@ bool service_runner::install() { // Run install script { std::string install_cmd = "'cd " + mRemote_service_template_path + - " && /bin/bash _install.sh " + mRemote_service_env_file + "'"; + " && /bin/bash install.sh " + mRemote_service_env_file + "'"; bool ok= execute_ssh_command(install_cmd, "Failed to run install script"); if (!ok) return false; @@ -324,7 +324,7 @@ service_runner::HealthStatus service_runner::is_healthy() } // Check if status script exists - std::string command = "_status"; + std::string command = "status"; if (!template_command_exists(m_service_info.template_name, command)) { return HealthStatus::UNKNOWN; @@ -386,7 +386,7 @@ std::vector service_runner::get_ports() } // Check if ports script exists - std::string command = "_ports"; + std::string command = "ports"; if (!template_command_exists(m_service_info.template_name, command)) { return ports; } diff --git a/templates/example/_basic.env b/templates/example/_basic.env index a26eeaa..fc207fa 100644 --- a/templates/example/_basic.env +++ b/templates/example/_basic.env @@ -1,5 +1,4 @@ # Service settings specific to this server -TEMPLATE=example # Application settings CONTAINER_PORT=8181 diff --git a/templates/example/example/service.env b/templates/example/example/service.env index f9d95ae..851c557 100644 --- a/templates/example/example/service.env +++ b/templates/example/example/service.env @@ -1,6 +1,8 @@ +# Template to use - always required! +TEMPLATE=example + # Service settings specific to this server # (can also override anything in the _basic.env file in the template to make it specific to this server) - HOST_PORT=80 LOCAL_DATA_FOLDER="${HOME}/.example" IMAGE_TAG="latest" diff --git a/templates/watchtower/_basic.env b/templates/watchtower/_basic.env index 8438555..ee38801 100644 --- a/templates/watchtower/_basic.env +++ b/templates/watchtower/_basic.env @@ -1,6 +1,4 @@ # Service settings -TEMPLATE=watchtower - CONTAINER_NAME=watchtower # Interval in seconds between checks. diff --git a/templates/watchtower/_common.sh b/templates/watchtower/_common.sh index 6a5d2cf..8dfab27 100755 --- a/templates/watchtower/_common.sh +++ b/templates/watchtower/_common.sh @@ -63,6 +63,10 @@ grey_end() { } create_and_start_container() { + if [ -z "$1" ] || [ -z "$2" ]; then + die "Template error: create_and_start_container " + fi + local run_cmd="$1" local container_name="$2" diff --git a/templates/watchtower/example/service.env b/templates/watchtower/example/service.env index 769b305..f4d625b 100644 --- a/templates/watchtower/example/service.env +++ b/templates/watchtower/example/service.env @@ -1,6 +1,9 @@ -# Service settings +# Template to use - always required! +TEMPLATE=watchtower + +# Service settings specific to this server +# (can also override anything in the _basic.env file in the template to make it specific to this server) # Interval in seconds between checks. # Default is 1800 seconds (30 minutes). -INTERVAL=1800 - +INTERVAL=1800 \ No newline at end of file diff --git a/templates/watchtower/_status.sh b/templates/watchtower/status.sh similarity index 100% rename from templates/watchtower/_status.sh rename to templates/watchtower/status.sh