diff --git a/scripts/obico.sh b/scripts/obico.sh index 9113e62..f212345 100644 --- a/scripts/obico.sh +++ b/scripts/obico.sh @@ -365,23 +365,33 @@ function update_moonraker_obico() { #===================================================# function get_moonraker_obico_status() { - local moonraker_obico_services sf_count status - moonraker_obico_services=$(moonraker_obico_systemd) - sf_count=$(echo "${moonraker_obico_services}" | wc -w ) + local status + local service_count + local is_linked + local moonraker_obico_services - if (( sf_count == 0 )); then - status="Not installed!" - elif [[ ! -e "${MOONRAKER_OBICO_DIR}" ]]; then - status="Incomplete!" - else - status="Installed!" + moonraker_obico_services=$(moonraker_obico_systemd) + service_count=$(echo "${moonraker_obico_services}" | wc -w ) + + is_linked="true" + if [[ -n ${moonraker_obico_services} ]]; then for service in ${moonraker_obico_services}; do if ! is_moonraker_obico_linked "$(get_instance_name "${service}" moonraker-obico)"; then - status="Not linked!" + is_linked="false" fi done fi + if (( service_count == 0 )); then + status="Not installed!" + elif [[ ! -d "${MOONRAKER_OBICO_DIR}" ]]; then + status="Incomplete!" + elif [[ ${is_linked} == "false" ]]; then + status="Not linked!" + else + status="Installed!" + fi + echo "${status}" } diff --git a/scripts/ui/main_menu.sh b/scripts/ui/main_menu.sh index 91092cc..925fca6 100755 --- a/scripts/ui/main_menu.sh +++ b/scripts/ui/main_menu.sh @@ -49,7 +49,10 @@ function print_status() { if [[ ${status} == "Not installed!" ]]; then status="${red}${status}${white}" - elif [[ ${status} == "Incomplete!" ]] || [[ ${status} == "Not linked!" ]]; then + elif [[ ${status} == "Incomplete!" ]]; then + status="${yellow}${status}${white}" + elif [[ ${status} == "Not linked!" ]]; then + ### "Not linked!" is only required for Moonraker-obico status="${yellow}${status}${white}" else status="${green}${status}${white}"