theocorp_docker_compose/restart_container.sh
geezo 39c9b7a048
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
changes
2025-05-07 01:45:09 +00:00

25 lines
524 B
Bash
Executable File

#!/bin/bash
# Check if a value was provided
if [ -z "$1" ]; then
echo "Usage: $0 <value>"
exit 1
fi
# Use the provided argument
VALUE="$1"
TARGET_DIR="/home/geezo/docker_containers/$VALUE"
# Check if the directory exists
if [ ! -d "$TARGET_DIR" ]; then
echo "Error: Directory $TARGET_DIR does not exist."
exit 1
fi
# Navigate to the target directory
cd "$TARGET_DIR" || { echo "Failed to change directory to $TARGET_DIR"; exit 1; }
# Run Docker Compose commands
docker compose down
docker compose up -d