chore: refactor how moonraker is detected

This commit is contained in:
th33xitus
2021-11-11 13:21:57 +01:00
committed by GitHub
parent 19ddf3e023
commit fe4625d3e1

View File

@@ -1,13 +1,13 @@
system_check_webui(){ system_check_webui(){
### check system for installed moonraker service ### check system for installed moonraker service
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "moonraker.service")" ] || [ "$(systemctl list-units --full -all -t service --no-legend | grep -E "moonraker-[[:digit:]].service")" ]; then if ls /etc/systemd/system/moonraker.service 2>/dev/null || ls /etc/systemd/system | grep -q -E "moonraker-[[:digit:]]+.service"; then
moonraker_chk_ok="true" moonraker_chk_ok="true"
else else
moonraker_chk_ok="false" moonraker_chk_ok="false"
fi fi
### check system for an installed and enabled octoprint service ### check system for an installed and enabled octoprint service
if systemctl list-unit-files | grep -E "octoprint.*" | grep "enabled" &>/dev/null; then if sudo systemctl list-unit-files | grep -E "octoprint.*" | grep "enabled" &>/dev/null; then
OCTOPRINT_ENABLED="true" OCTOPRINT_ENABLED="true"
fi fi