#!/bin/bash
# 快速检查部署状态

NAS_USER="fnvtk"
NAS_IP="192.168.2.201"
NAS_PASSWORD="Zhiqun1984"
SUDO_PASSWORD="Zhiqun1984"
DOCKER_CMD="/volume1/@appstore/ContainerManager/usr/bin/docker"
PROJECT_DIR="/volume1/docker/soul-book"

expect << EOF
set timeout 30
spawn ssh -t -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc $NAS_USER@$NAS_IP "sudo $DOCKER_CMD ps -a | grep soul; echo '---'; curl -s http://localhost:3000 | head -20 || echo '服务未响应'"
expect {
    "password:" {
        send "$NAS_PASSWORD\r"
        exp_continue
    }
    "Password:" {
        send "$SUDO_PASSWORD\r"
        exp_continue
    }
}
expect eof
EOF
