ha-3dprinter-addons/klipper/rootfs/etc/services.d/moonraker/run
2023-01-12 02:19:26 +01:00

20 lines
626 B
Plaintext

#!/usr/bin/with-contenv bashio
bashio::log.info "Starting Moonraker..."
MOONRAKER_PYTHON=/data/python/moonraker/bin/python
MOONRAKER=/data/src/moonraker/moonraker/moonraker.py
if [ -f /data/config/klipper/moonraker.conf ]; then
bashio::log.notice "Using custom moonraker.conf"
MOONRAKER_CFG=/data/config/klipper/moonraker.conf
else
bashio::log.notice "Using default moonraker.conf"
MOONRAKER_CFG=/root/config/moonraker/moonraker.conf
fi
MOONRAKER_LOGFILE=/tmp/moonraker.log
touch ${MOONRAKER_LOGFILE}
touch ${MOONRAKER_CFG}
exec ${MOONRAKER_PYTHON} ${MOONRAKER} -c ${MOONRAKER_CFG} -l ${MOONRAKER_LOGFILE}