ha-3dprinter-addons/3dprinter-octoprint/rootfs/etc/cont-init.d/octoprint.sh
2022-06-27 01:26:41 +02:00

22 lines
757 B
Bash

#!/usr/bin/with-contenv bashio
# ==============================================================================
# Prepare OctoPrint
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
whoami
{ # Check if OctoPrint is installed
bashio::log.info "Check OctoPrint version..."
octoprint --version
} || { # Otherwise install
{ # Check if Python is available
bashio::log.info "Check Python version..."
python --version
} || { # Otherwise install
bashio::log.info "Install Python..."
python3 -m venv /data/python/octoprint
}
bashio::log.info "Install OctoPrint..."
pip install octoprint==$OCTOPRINT_VERSION
}