theocorp_docker_compose/restart_container.sh
2025-05-06 21:59:42 -04:00

27 lines
534 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; }
git pull
# Run Docker Compose commands
docker compose down
docker compose up -d