diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 3d3d3e7..b38193e 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -364,36 +364,33 @@ function get_klipper_status(){ } function get_local_klipper_commit(){ - if [ -d "${KLIPPER_DIR}" ] && [ -d "${KLIPPER_DIR}"/.git ]; then - cd "${KLIPPER_DIR}" - commit="$(git describe HEAD --always --tags | cut -d "-" -f 1,2)" - else - commit="${NONE}" - fi + [ ! -d "${KLIPPER_DIR}" ] || [ ! -d "${KLIPPER_DIR}"/.git ] && return + cd "${KLIPPER_DIR}" + commit="$(git describe HEAD --always --tags | cut -d "-" -f 1,2)" echo "${commit}" } function get_remote_klipper_commit(){ - if [ -d "${KLIPPER_DIR}" ] && [ -d "${KLIPPER_DIR}"/.git ]; then - cd "${KLIPPER_DIR}" - git fetch origin -q - commit=$(git describe origin/master --always --tags | cut -d "-" -f 1,2) - else - commit="${NONE}" - fi + [ ! -d "${KLIPPER_DIR}" ] || [ ! -d "${KLIPPER_DIR}"/.git ] && return + cd "${KLIPPER_DIR}" && git fetch origin -q + commit=$(git describe origin/master --always --tags | cut -d "-" -f 1,2) echo "${commit}" } function compare_klipper_versions(){ unset KLIPPER_UPDATE_AVAIL - if [ "$(get_local_klipper_commit)" != "$(get_remote_klipper_commit)" ]; then - LOCAL_COMMIT="${yellow}$(printf "%-12s" "$(get_local_klipper_commit)")${default}" - REMOTE_COMMIT="${green}$(printf "%-12s" "$(get_remote_klipper_commit)")${default}" + local versions local_ver remote_ver + local_ver="$(get_local_klipper_commit)" + remote_ver="$(get_remote_klipper_commit)" + if [ "${local_ver}" != "${remote_ver}" ]; then + versions="${yellow}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" # add klipper to the update all array for the update all function in the updater KLIPPER_UPDATE_AVAIL="true" && update_arr+=(update_klipper) else - LOCAL_COMMIT="${green}$(printf "%-12s" "$(get_remote_klipper_commit)")${default}" - REMOTE_COMMIT="${green}$(printf "%-12s" "$(get_remote_klipper_commit)")${default}" + versions="${green}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" KLIPPER_UPDATE_AVAIL="false" fi + echo "${versions}" } \ No newline at end of file diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh index 491b825..f1ef049 100644 --- a/scripts/moonraker.sh +++ b/scripts/moonraker.sh @@ -493,14 +493,18 @@ function get_remote_moonraker_commit(){ function compare_moonraker_versions(){ unset MOONRAKER_UPDATE_AVAIL - if [ "$(get_local_moonraker_commit)" != "$(get_remote_moonraker_commit)" ]; then - LOCAL_COMMIT="${yellow}$(printf "%-12s" "$(get_local_moonraker_commit)")${white}" - REMOTE_COMMIT="${green}$(printf "%-12s" "$(get_remotemoonrakerr_commit)")${white}" + local versions local_ver remote_ver + local_ver="$(get_local_moonraker_commit)" + remote_ver="$(get_remote_moonraker_commit)" + if [ "${local_ver}" != "${remote_ver}" ]; then + versions="${yellow}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" # add klipper to the update all array for the update all function in the updater MOONRAKER_UPDATE_AVAIL="true" && update_arr+=(update_moonraker) else - LOCAL_COMMIT="${green}$(printf "%-12s" "$(get_remote_moonraker_commit)")${white}" - REMOTE_COMMIT="${green}$(printf "%-12s" "$(get_remote_moonraker_commit)")${white}" - KLIPPER_UPDATE_AVAIL="false" + versions="${green}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" + MOONRAKER_UPDATE_AVAIL="false" fi + echo "${versions}" } diff --git a/scripts/status.sh b/scripts/status.sh index 1d3ec35..e85ca18 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -435,13 +435,13 @@ NONE="${red}$(printf "%-12s" "--------")${default}" ui_print_versions(){ unset update_arr check_system_updates - compare_klipper_versions - compare_dwc2fk_versions - compare_dwc2_versions - compare_moonraker_versions - compare_mainsail_versions - compare_fluidd_versions - compare_klipperscreen_versions - compare_MoonrakerTelegramBot_versions - compare_pgc_versions +# compare_klipper_versions +# compare_dwc2fk_versions +# compare_dwc2_versions +# compare_moonraker_versions +# compare_mainsail_versions +# compare_fluidd_versions +# compare_klipperscreen_versions +# compare_MoonrakerTelegramBot_versions +# compare_pgc_versions } diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index 5c8fc13..0eda727 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -6,17 +6,16 @@ install_ui(){ echo -e "| all necessary dependencies for the various | " echo -e "| functions on a completely fresh system. | " hr - echo -e "| Firmware: | Touchscreen GUI: | " - echo -e "| 1) [Klipper] | 5) [KlipperScreen] | " - echo -e "| | | " - echo -e "| Klipper API: | Other: | " - echo -e "| 2) [Moonraker] | 6) [Duet Web Control] | " - echo -e "| | 7) [OctoPrint] | " - echo -e "| Klipper Webinterface: | 8) [PrettyGCode] | " - echo -e "| 3) [Mainsail] | 9) [Telegram Bot] | " - echo -e "| 4) [Fluidd] | | " - echo -e "| | Webcam: | " + echo -e "| Firmware & API: | Other: | " + echo -e "| 1) [Klipper] | 6) [Duet Web Control] | " + echo -e "| 2) [Moonraker] | 7) [OctoPrint] | " + echo -e "| | 8) [PrettyGCode] | " + echo -e "| Klipper Webinterface: | 9) [Telegram Bot] | " + echo -e "| 3) [Mainsail] | | " + echo -e "| 4) [Fluidd] | Webcam: | " echo -e "| | 10) [MJPG-Streamer] | " + echo -e "| Touchscreen GUI: | | " + echo -e "| 5) [KlipperScreen] | | " back_footer } diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 0d23c74..85d30d9 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -6,12 +6,12 @@ update_ui(){ echo -e "| 0) $BB4U_STATUS| " hr echo -e "| a) [Update all] | | | " - echo -e "| | Local Vers: | Remote Vers: | " - echo -e "| Klipper/Klipper API: |---------------|--------------| " - echo -e "| 1) [Klipper] | $LOCAL_COMMIT | $REMOTE_COMMIT | " - echo -e "| 2) [Moonraker] | $LOCAL_MOONRAKER_COMMIT | $REMOTE_MOONRAKER_COMMIT | " + echo -e "| | Installed: | Latest: | " + echo -e "| Klipper & API : |---------------|--------------| " + echo -e "| 1) [Klipper] |$(compare_klipper_versions)| " + echo -e "| 2) [Moonraker] |$(compare_moonraker_versions)| " echo -e "| | | | " - echo -e "| Klipper Webinterface: |---------------|--------------| " + echo -e "| Webinterface: |---------------|--------------| " echo -e "| 3) [Mainsail] | $MAINSAIL_LOCAL_VER | $MAINSAIL_REMOTE_VER | " echo -e "| 4) [Fluidd] | $FLUIDD_LOCAL_VER | $FLUIDD_REMOTE_VER | " echo -e "| | | | "