fix: performance improvement for loading the advanced menu ui

This commit is contained in:
th33xitus
2021-06-13 11:59:12 +02:00
parent 54089582e4
commit 72312422e3
2 changed files with 8 additions and 3 deletions

View File

@@ -248,6 +248,9 @@ toggle_octoprint_service(){
read_octoprint_service_status(){
unset OPRINT_SERVICE_STATUS
if [ ! -f "/etc/systemd/system/octoprint.service" ]; then
return 0
fi
if systemctl list-unit-files | grep -E "octoprint*" | grep "enabled" &>/dev/null; then
OPRINT_SERVICE_STATUS="${red}[Disable]${default} OctoPrint Service "
else

View File

@@ -2,9 +2,11 @@ advanced_ui(){
top_border
echo -e "| ${yellow}~~~~~~~~~~~~~ [ Advanced Menu ] ~~~~~~~~~~~~~${default} | "
hr
echo -e "| 0) $OPRINT_SERVICE_STATUS| "
hr
echo -e "| | | "
if [ ! "$OPRINT_SERVICE_STATUS" == "" ]; then
echo -e "| 0) $OPRINT_SERVICE_STATUS| "
hr
echo -e "| | | "
fi
echo -e "| Klipper: | Mainsail: | "
echo -e "| 1) [Switch Branch] | 7) [Theme installer] | "
echo -e "| 2) [Rollback] | | "