Configuration de déploiement unifié NationsGlory
- Scripts de déploiement (deploy.sh, stop.sh, check-config.sh) - Documentation complète (README, QUICKSTART, etc.) - Configuration portable avec chemins relatifs
This commit is contained in:
69
stop.sh
Executable file
69
stop.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
#######################################
|
||||
# Script d'arrêt NationsGlory
|
||||
# Arrête le serveur Minecraft et l'application web admin
|
||||
#######################################
|
||||
|
||||
set -e
|
||||
|
||||
# Couleurs pour les logs
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() {
|
||||
echo -e "${BLUE}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# Récupérer le chemin absolu du script
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
MC_SERVER_DIR="${SCRIPT_DIR}/NationsGlory_ServeurBuild_Red"
|
||||
WEB_ADMIN_DIR="${SCRIPT_DIR}/WebNationsGlory_ServeurBuild_Red"
|
||||
|
||||
# Détecter la commande docker compose
|
||||
if docker compose version &> /dev/null; then
|
||||
DOCKER_COMPOSE="docker compose"
|
||||
else
|
||||
DOCKER_COMPOSE="docker-compose"
|
||||
fi
|
||||
|
||||
log_info "═══════════════════════════════════════════════════════"
|
||||
log_info " Arrêt NationsGlory - Serveur & Web Admin"
|
||||
log_info "═══════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
# Arrêt de l'application web
|
||||
if [ -d "$WEB_ADMIN_DIR" ]; then
|
||||
log_info "Arrêt de l'application web admin..."
|
||||
cd "$WEB_ADMIN_DIR"
|
||||
$DOCKER_COMPOSE down
|
||||
log_success "✓ Application web arrêtée"
|
||||
else
|
||||
log_error "Dossier web admin introuvable: $WEB_ADMIN_DIR"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Arrêt du serveur Minecraft
|
||||
if [ -d "$MC_SERVER_DIR" ]; then
|
||||
log_info "Arrêt du serveur Minecraft..."
|
||||
cd "$MC_SERVER_DIR"
|
||||
$DOCKER_COMPOSE down
|
||||
log_success "✓ Serveur Minecraft arrêté"
|
||||
else
|
||||
log_error "Dossier serveur MC introuvable: $MC_SERVER_DIR"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
log_success "🛑 Tous les services sont arrêtés"
|
||||
Reference in New Issue
Block a user