modified
This commit is contained in:
11
fix_gcc.sh
11
fix_gcc.sh
@@ -5,7 +5,7 @@ SERVICE_NAME="lgsm-cs"
|
||||
|
||||
# Function to check if the container is running
|
||||
is_container_running() {
|
||||
[ "$(docker container inspect -f '{{.State.Status}}' "${SERVICE_NAME}")" = "running" ]
|
||||
[ "$(docker container inspect -f '{{.State.Status}}' "${SERVICE_NAME}" 2>/dev/null)" = "running" ]
|
||||
}
|
||||
|
||||
# Function to execute commands in the container
|
||||
@@ -13,8 +13,13 @@ execute_in_container() {
|
||||
docker-compose exec -d "${SERVICE_NAME}" sh -c "$1"
|
||||
}
|
||||
|
||||
# Start the container using docker-compose
|
||||
docker-compose up -d "${SERVICE_NAME}"
|
||||
# Check if the container is already running, if not, start it
|
||||
if ! is_container_running; then
|
||||
echo "Container ${SERVICE_NAME} is not running. Starting it..."
|
||||
docker-compose up -d "${SERVICE_NAME}"
|
||||
else
|
||||
echo "Container ${SERVICE_NAME} is already running."
|
||||
fi
|
||||
|
||||
# Wait for container to be fully up and running
|
||||
echo "Waiting for container ${SERVICE_NAME} to be fully up and running..."
|
||||
|
||||
Reference in New Issue
Block a user