#!/usr/bin/env bash # Verify script dependencies for scripts/verify/* and deployment/automation # See scripts/verify/README.md and docs/11-references/APT_PACKAGES_CHECKLIST.md set -euo pipefail REQUIRED=(bash curl jq openssl ssh) # Optional: used by push-templates, storage-monitor, set-container-password, Blockscout/restart scripts, etc. OPTIONAL=(sshpass rsync dig ss sqlite3 wscat websocat screen tmux htop shellcheck parallel) MISSING=() OPTIONAL_MISSING=() for cmd in "${REQUIRED[@]}"; do if ! command -v "$cmd" &>/dev/null; then MISSING+=("$cmd") fi done if [ ${#MISSING[@]} -gt 0 ]; then echo "Missing required: ${MISSING[*]}" exit 1 fi for cmd in "${OPTIONAL[@]}"; do if ! command -v "$cmd" &>/dev/null; then OPTIONAL_MISSING+=("$cmd") fi done echo "All required dependencies present: ${REQUIRED[*]}" if [ ${#OPTIONAL_MISSING[@]} -gt 0 ]; then echo "Optional (recommended for automation): ${OPTIONAL[*]}" echo "Missing optional: ${OPTIONAL_MISSING[*]}" echo "Install (Debian/Ubuntu): sudo apt install -y sshpass rsync dnsutils iproute2 screen tmux htop shellcheck parallel sqlite3" echo " (dig from dnsutils; ss from iproute2; wscat/websocat: npm install -g wscat or cargo install websocat)" fi exit 0