forked from finn/tinyboard
setup-opds.sh: prompt user to install Docker if not found, using same approach as setup-spoke.sh
This commit is contained in:
@@ -14,7 +14,26 @@ header() { echo -e "\n${CYAN}═════════════════
|
|||||||
|
|
||||||
[ "$(id -u)" -eq 0 ] || die "Run as root"
|
[ "$(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"
|
header "TinyBoard OPDS Setup"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user