Fix uninstall script

This commit is contained in:
Your Name 2025-05-03 18:59:38 +12:00
parent fc8a142e91
commit e10704636f
3 changed files with 16 additions and 2 deletions

View File

@ -120,7 +120,7 @@ bool service_runner::uninstall() {
} }
// 3. Run uninstall script if it exists // 3. Run uninstall script if it exists
std::string uninstall_script = remotepath::service_template(mServer, mService) + "/_uninstall.sh"; std::string uninstall_script = remotepath::service_template(mServer, mService) + "/uninstall.sh";
bool script_exists = mServerEnv.check_remote_file_exists(uninstall_script); bool script_exists = mServerEnv.check_remote_file_exists(uninstall_script);
if (script_exists) { if (script_exists) {

View File

@ -0,0 +1,14 @@
#!/bin/bash
source "$(dirname "$0")/_common.sh"
check_required_env_vars "CONTAINER_NAME"
if ! _is_container_running "$CONTAINER_NAME"; then
die "Container ${CONTAINER_NAME} is not running. Can't connect to it."
fi
echo "Connecting to ${CONTAINER_NAME}..."
docker exec -it ${CONTAINER_NAME} bash
echo "Disconnected from ${CONTAINER_NAME}"

View File

@ -6,7 +6,7 @@
# It is called with the path to the server specific env file as an argument. # It is called with the path to the server specific env file as an argument.
source "$(dirname "$0")/_common.sh" source "$(dirname "$0")/_common.sh"
check_required_env_vars "CONTAINER_NAME" "HOST_PORT" "VOLUME_NAME" check_required_env_vars "CONTAINER_NAME" "HOST_PORT" "VOLUME_NAME" "WRITE_TOKENS"
# check volume exists. # check volume exists.
if ! docker volume inspect "${VOLUME_NAME}" &>/dev/null; then if ! docker volume inspect "${VOLUME_NAME}" &>/dev/null; then