Files
proxmox/scripts/archive/consolidated/verify/check-dependencies.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

143 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
# Check for required dependencies for verification scripts
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
log_error() { echo -e "${RED}[✗]${NC} $1"; }
# Required tools
REQUIRED_TOOLS=(
"bash"
"curl"
"jq"
"dig"
"openssl"
"ssh"
"ss"
"systemctl"
)
# Optional tools
OPTIONAL_TOOLS=(
"wscat:WebSocket testing"
"websocat:WebSocket testing"
"sqlite3:Database backup/restore"
)
MISSING_REQUIRED=()
MISSING_OPTIONAL=()
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 Checking Dependencies"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Check required tools
log_info "Checking required tools..."
for tool in "${REQUIRED_TOOLS[@]}"; do
if command -v "$tool" >/dev/null 2>&1; then
VERSION=$(bash --version 2>/dev/null | head -1 || echo "installed")
log_success "$tool: installed"
else
log_error "$tool: MISSING"
MISSING_REQUIRED+=("$tool")
fi
done
echo ""
# Check optional tools
log_info "Checking optional tools..."
for tool_desc in "${OPTIONAL_TOOLS[@]}"; do
IFS=':' read -r tool desc <<< "$tool_desc"
if command -v "$tool" >/dev/null 2>&1; then
log_success "$tool: installed ($desc)"
else
log_warn "$tool: not installed ($desc)"
MISSING_OPTIONAL+=("$tool")
fi
done
echo ""
# Summary
if [ ${#MISSING_REQUIRED[@]} -eq 0 ]; then
log_success "All required dependencies are installed"
EXIT_CODE=0
else
log_error "Missing required dependencies: ${MISSING_REQUIRED[*]}"
echo ""
log_info "Installation commands:"
echo ""
# Detect OS and provide installation commands
if [ -f /etc/debian_version ]; then
log_info "Debian/Ubuntu:"
INSTALL_CMD="apt-get install -y"
for tool in "${MISSING_REQUIRED[@]}"; do
case "$tool" in
"jq")
echo " $INSTALL_CMD jq"
;;
"dig")
echo " $INSTALL_CMD dnsutils"
;;
"ss")
echo " $INSTALL_CMD iproute2"
;;
*)
echo " $INSTALL_CMD $tool"
;;
esac
done
elif [ -f /etc/redhat-release ]; then
log_info "RedHat/CentOS:"
INSTALL_CMD="yum install -y"
for tool in "${MISSING_REQUIRED[@]}"; do
case "$tool" in
"jq")
echo " $INSTALL_CMD jq"
;;
"dig")
echo " $INSTALL_CMD bind-utils"
;;
"ss")
echo " $INSTALL_CMD iproute"
;;
*)
echo " $INSTALL_CMD $tool"
;;
esac
done
else
log_info "Please install the following packages for your distribution:"
for tool in "${MISSING_REQUIRED[@]}"; do
echo " - $tool"
done
fi
EXIT_CODE=1
fi
if [ ${#MISSING_OPTIONAL[@]} -gt 0 ]; then
echo ""
log_warn "Optional tools not installed: ${MISSING_OPTIONAL[*]}"
log_info "These are not required but may be useful for advanced testing"
fi
echo ""
exit $EXIT_CODE