diff --git a/modules/backup/acronis-agent-status.sh b/modules/backup/acronis-agent-status.sh index 3183e98..93de47e 100755 --- a/modules/backup/acronis-agent-status.sh +++ b/modules/backup/acronis-agent-status.sh @@ -188,16 +188,30 @@ fi echo "" # Check outbound connectivity to cloud (port 443) +echo "" +echo -e "${BOLD}Cloud Connectivity Test:${NC}" + if command -v curl >/dev/null 2>&1; then reg_url=$(grep -oP '
\K[^<]+' /var/lib/Acronis/BackupAndRecovery/MMS/user.config 2>/dev/null) if [ -n "$reg_url" ]; then - echo -n "Testing cloud connectivity... " - if timeout 5 curl -s -o /dev/null -w "%{http_code}" "$reg_url" 2>/dev/null | grep -q "^[2-4]"; then - echo -e "${GREEN}✓${NC} Connected" + echo -n " Testing ${reg_url}... " + + http_code=$(timeout 5 curl -s -o /dev/null -w "%{http_code}" "$reg_url" 2>/dev/null) + + if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 500 ]; then + echo -e "${GREEN}✓ Reachable${NC} (HTTP $http_code)" else - echo -e "${YELLOW}⚠${NC} Cannot reach cloud (may be firewall/network issue)" + echo -e "${RED}✗ Unreachable${NC}" + echo -e " ${YELLOW}⚠${NC} Cannot reach Acronis cloud (firewall/network issue)" + echo " • Check internet connectivity" + echo " • Verify firewall allows HTTPS (port 443)" + echo " • Test manually: curl -I $reg_url" fi + else + echo -e " ${YELLOW}⚠${NC} Cloud URL not found in config" fi +else + echo -e " ${YELLOW}⚠${NC} curl not installed (cannot test connectivity)" fi echo ""