diff --git a/scripts/obico.sh b/scripts/obico.sh index 012079b..cd4b585 100644 --- a/scripts/obico.sh +++ b/scripts/obico.sh @@ -421,3 +421,18 @@ function compare_moonraker_obico_versions() { echo "${versions}" } + +### +# it is possible, that moonraker_obico is installed in a so called +# "non-linked" state. the linking can be achieved by running the +# installation script again. this function will check the obico +# installation status and returns the correctly formulated menu title +# +function obico_install_title() { + if [[ $(get_moonraker_obico_status) == "Not linked!" ]]; then + echo "[Link to Obico Server]" + else + echo "[Obico for Klipper] " + fi +} + diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index 5cbda6e..04f56c6 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -12,11 +12,6 @@ set -e function install_ui() { - local moonraker_obico_status=$(print_status "moonraker_obico") moonraker_obico_menu="[Obico for Klipper] " - if echo ${moonraker_obico_status} | grep -q "Not linked!"; then - moonraker_obico_menu="[Link to Obico Server]" - fi - top_border echo -e "| ${green}~~~~~~~~~~~ [ Installation Menu ] ~~~~~~~~~~~${white} |" hr @@ -24,16 +19,16 @@ function install_ui() { echo -e "| all necessary dependencies for the various |" echo -e "| functions on a completely fresh system. |" hr - echo -e "| Firmware & API: | 3rd Party Webinterface: |" - echo -e "| 1) [Klipper] | 6) [OctoPrint] |" - echo -e "| 2) [Moonraker] | |" - echo -e "| | Other: |" - echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" - echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" - echo -e "| 4) [Fluidd] | 9) ${moonraker_obico_menu}|" - echo -e "| | |" - echo -e "| Touchscreen GUI: | Webcam Streamer: |" - echo -e "| 5) [KlipperScreen] | 10) [MJPG-Streamer] |" + echo -e "| Firmware & API: | 3rd Party Webinterface: |" + echo -e "| 1) [Klipper] | 6) [OctoPrint] |" + echo -e "| 2) [Moonraker] | |" + echo -e "| | Other: |" + echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" + echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" + echo -e "| 4) [Fluidd] | 9) $(obico_install_title) |" + echo -e "| | |" + echo -e "| Touchscreen GUI: | Webcam Streamer: |" + echo -e "| 5) [KlipperScreen] | 10) [MJPG-Streamer] |" back_footer }