diff --git a/hub/setup-opds.sh b/hub/setup-opds.sh index fd90d7c..b691b27 100755 --- a/hub/setup-opds.sh +++ b/hub/setup-opds.sh @@ -14,7 +14,26 @@ header() { echo -e "\n${CYAN}═════════════════ [ "$(id -u)" -eq 0 ] || die "Run as root" -command -v docker >/dev/null 2>&1 || die "Docker not found. Install Docker first." +if ! command -v docker >/dev/null 2>&1; then + warn "Docker is not installed." + read -rp "Install Docker now? [Y/n]: " INSTALL_DOCKER + INSTALL_DOCKER="${INSTALL_DOCKER:-y}" + if [[ "${INSTALL_DOCKER,,}" == "y" ]]; then + header "Installing Docker" + if command -v apt-get >/dev/null 2>&1; then + apt-get update -q + apt-get install -y -q docker.io docker-cli docker-compose + else + curl -fsSL https://get.docker.com | bash + fi + if ! command -v docker >/dev/null 2>&1; then + die "Docker installation failed." + fi + info "Docker installed." + else + die "Docker is required. Aborting." + fi +fi header "TinyBoard OPDS Setup" echo ""