modified
This commit is contained in:
22
fix_gcc.sh
22
fix_gcc.sh
@@ -5,7 +5,15 @@ CONTAINER_NAME="lgsm-cs"
|
||||
|
||||
# Function to check if the container is running
|
||||
is_container_running() {
|
||||
[[ "$(docker inspect -f '{{.State.Running}}' "${CONTAINER_NAME}" 2>/dev/null)" == "true" ]]
|
||||
docker inspect -f '{{.State.Running}}' "${CONTAINER_NAME}" 2>/dev/null
|
||||
}
|
||||
|
||||
# Function to wait for the container to be fully up and running
|
||||
wait_for_container() {
|
||||
echo "Waiting for container ${CONTAINER_NAME} to be fully up and running..."
|
||||
while ! docker exec "${CONTAINER_NAME}" echo "Container is up" &>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# Function to execute commands in the container
|
||||
@@ -13,17 +21,11 @@ execute_in_container() {
|
||||
docker exec -d "${CONTAINER_NAME}" sh -c "$1"
|
||||
}
|
||||
|
||||
# Ensure the container is running
|
||||
if ! is_container_running; then
|
||||
# Check if container is running
|
||||
if [ "$(is_container_running)" != "true" ]; then
|
||||
echo "Container ${CONTAINER_NAME} is not running. Starting it..."
|
||||
docker start "${CONTAINER_NAME}"
|
||||
|
||||
# Wait for the container to be up
|
||||
echo "Waiting for the container to be fully up..."
|
||||
until is_container_running; do
|
||||
sleep 1
|
||||
done
|
||||
echo "Container ${CONTAINER_NAME} is now running."
|
||||
wait_for_container
|
||||
fi
|
||||
|
||||
# Moving and copying libstdc++.so.6
|
||||
|
||||
Reference in New Issue
Block a user