feat(deploy): Docker Compose production + script désinstallation
- docker-compose.yml : healthcheck, réseau interne, volumes nommés - docker-compose.dev.yml : profil développement (logs debug, restart no) - install/uninstall.sh : arrêt service, suppression binaire + config + unit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Désinstallation d'un agent SentinelMesh
|
||||
set -euo pipefail
|
||||
|
||||
AGENT_TYPE="${1:-}"
|
||||
[[ -z "$AGENT_TYPE" ]] && { echo "Usage: $0 <scan-network|metric>"; exit 1; }
|
||||
|
||||
SERVICE_NAME="sentinelmesh-${AGENT_TYPE}"
|
||||
BINARY="/usr/local/bin/agent-${AGENT_TYPE}"
|
||||
CONFIG="/etc/sentinelmesh/${AGENT_TYPE}.yaml"
|
||||
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
|
||||
|
||||
[[ "$EUID" -ne 0 ]] && { echo "Erreur : ce script doit être exécuté en root."; exit 1; }
|
||||
|
||||
echo "Désinstallation de ${SERVICE_NAME}…"
|
||||
|
||||
systemctl stop "$SERVICE_NAME" 2>/dev/null && echo " Service arrêté" || true
|
||||
systemctl disable "$SERVICE_NAME" 2>/dev/null && echo " Service désactivé" || true
|
||||
|
||||
rm -f "$SERVICE_FILE" && echo " Service systemd supprimé"
|
||||
rm -f "$BINARY" && echo " Binaire supprimé"
|
||||
rm -f "$CONFIG" && echo " Configuration supprimée"
|
||||
|
||||
systemctl daemon-reload
|
||||
echo "Désinstallation terminée."
|
||||
Reference in New Issue
Block a user