#!/bin/bash # ============================================================================== # Wallarm Docker Node Manager - Unified single-script manager # ============================================================================== # Delegates to the individual docker/* scripts for preflight, deployment, # reconfiguration, and removal — providing a single entry point matching the # native/wallarm-native.sh command interface. # # Commands: # --preflight Run preflight checks only (no installation). # --install Interactive deployment of a Wallarm Docker node. # --config Reconfigure an existing Docker node. # --remove Remove a Docker node completely. # --status Show running Wallarm containers. # --help|-h Show help. # ============================================================================== set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Shell script files this wrapper delegates to (must be in the same directory) CHECK_SCRIPT="${SCRIPT_DIR}/wallarm-ct-check.sh" DEPLOY_SCRIPT="${SCRIPT_DIR}/wallarm-ct-deploy.sh" RECONF_SCRIPT="${SCRIPT_DIR}/wallarm-ct-reconfigure.sh" REMOVE_SCRIPT="${SCRIPT_DIR}/wallarm-ct-uninstall.sh" show_help() { cat <&2 echo " Run setup.sh first to download all deployment scripts." >&2 exit 1 fi } case "${1:-}" in --preflight) require_script "$CHECK_SCRIPT" "Preflight (wallarm-ct-check.sh)" exec "$CHECK_SCRIPT" "${@:2}" ;; --install) require_script "$DEPLOY_SCRIPT" "Deploy (wallarm-ct-deploy.sh)" exec sudo "$DEPLOY_SCRIPT" "${@:2}" ;; --config) require_script "$RECONF_SCRIPT" "Reconfigure (wallarm-ct-reconfigure.sh)" exec sudo "$RECONF_SCRIPT" "${@:2}" ;; --remove) require_script "$REMOVE_SCRIPT" "Uninstall (wallarm-ct-uninstall.sh)" exec sudo "$REMOVE_SCRIPT" "${@:2}" ;; --status) echo "Wallarm Docker Nodes:" if command -v docker >/dev/null 2>&1; then docker ps --filter "name=wallarm-" \ --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" 2>/dev/null || true else echo " Docker is not installed or not in PATH." fi ;; --help|-h) show_help ;; *) show_help exit 1 ;; esac