63d0699cdd
Remove invalid _mirror_manager from daemon.json that prevented Docker from starting. Add 2-minute test apply with auto-rollback, final apply confirmation, emergency-restore CLI/UI, and post-restart Docker health checks. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
789 B
Bash
25 lines
789 B
Bash
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
INSTALL_DIR="${1:-/opt/mirror-manager}"
|
|
|
|
BIN="/usr/local/bin/mirror-manager"
|
|
|
|
|
|
|
|
echo "نصب Mirror Manager CLI..."
|
|
|
|
sudo mkdir -p /var/lib/mirror-manager/data
|
|
|
|
sudo cp "$INSTALL_DIR/mirror-manager" "$BIN"
|
|
|
|
sudo chmod +x "$BIN"
|
|
|
|
|
|
|
|
PROFILE_D="/etc/profile.d/mirror-manager.sh"
|
|
|
|
{
|
|
|
|
echo "export PYTHONPATH=$INSTALL_DIR"
|
|
|
|
echo "export MIRROR_CONTAINER_NAME=mirror-manager"
|
|
|
|
echo "export DATA_DIR=/var/lib/mirror-manager/data"
|
|
|
|
echo "export HOST_ROOT=/"
|
|
|
|
} | sudo tee "$PROFILE_D" > /dev/null
|
|
|
|
|
|
|
|
echo "CLI نصب شد: mirror-manager"
|
|
|
|
echo " mirror-manager emergency-restore # بازگردانی فوری"
|
|
|
|
echo " mirror-manager restore --last"
|
|
|
|
echo " mirror-manager restore --initial"
|
|
|
|
echo " mirror-manager status"
|
|
|
|
|