refactor: factor the menu title definition out into a separate function

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2022-08-13 13:39:50 +02:00
parent fa2b728037
commit a9332a2b6e
2 changed files with 25 additions and 15 deletions

View File

@@ -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
}