feat(spoolman): add update menu entry and update script

This commit is contained in:
Alessandro Maggi
2024-06-08 11:05:18 +02:00
parent 1a74fef314
commit 6a4433d66b
2 changed files with 72 additions and 18 deletions

View File

@@ -28,23 +28,26 @@ function update_ui() {
echo -e "| Touchscreen GUI: |---------------|--------------|"
echo -e "| 5) [KlipperScreen] |$(compare_klipperscreen_versions)|"
echo -e "| | | |"
echo -e "| Spool Manager: |---------------|--------------|"
echo -e "| 6) [Spoolman] |$(compare_spoolman_versions)|"
echo -e "| | | |"
echo -e "| Other: |---------------|--------------|"
echo -e "| 6) [PrettyGCode] |$(compare_prettygcode_versions)|"
echo -e "| 7) [Telegram Bot] |$(compare_telegram_bot_versions)|"
echo -e "| 8) [Obico for Klipper]|$(compare_moonraker_obico_versions)|"
echo -e "| 9) [OctoEverywhere] |$(compare_octoeverywhere_versions)|"
echo -e "| 10) [Mobileraker] |$(compare_mobileraker_versions)|"
echo -e "| 11) [Crowsnest] |$(compare_crowsnest_versions)|"
echo -e "| 12) [OctoApp] |$(compare_octoapp_versions)|"
echo -e "| 7) [PrettyGCode] |$(compare_prettygcode_versions)|"
echo -e "| 8) [Telegram Bot] |$(compare_telegram_bot_versions)|"
echo -e "| 9) [Obico for Klipper]|$(compare_moonraker_obico_versions)|"
echo -e "| 10) [OctoEverywhere] |$(compare_octoeverywhere_versions)|"
echo -e "| 11) [Mobileraker] |$(compare_mobileraker_versions)|"
echo -e "| 12) [Crowsnest] |$(compare_crowsnest_versions)|"
echo -e "| 13) [OctoApp] |$(compare_octoapp_versions)|"
echo -e "| |------------------------------|"
echo -e "| 13) [System] | $(check_system_updates) |"
echo -e "| 14) [System] | $(check_system_updates) |"
back_footer
}
function update_menu() {
clear -x && sudo true && clear -x # (re)cache sudo credentials so password prompt doesn't bork ui
do_action "" "update_ui"
local action
while true; do
read -p "${cyan}####### Perform action:${white} " action
@@ -62,20 +65,22 @@ function update_menu() {
5)
do_action "update_klipperscreen" "update_ui";;
6)
do_action "update_pgc_for_klipper" "update_ui";;
do_action "update_spoolman" "update_ui";;
7)
do_action "update_telegram_bot" "update_ui";;
do_action "update_pgc_for_klipper" "update_ui";;
8)
do_action "update_moonraker_obico" "update_ui";;
do_action "update_telegram_bot" "update_ui";;
9)
do_action "update_octoeverywhere" "update_ui";;
do_action "update_moonraker_obico" "update_ui";;
10)
do_action "update_mobileraker" "update_ui";;
do_action "update_octoeverywhere" "update_ui";;
11)
do_action "update_crowsnest" "update_ui";;
do_action "update_mobileraker" "update_ui";;
12)
do_action "update_octoapp" "update_ui";;
do_action "update_crowsnest" "update_ui";;
13)
do_action "update_octoapp" "update_ui";;
14)
do_action "upgrade_system_packages" "update_ui";;
a)
do_action "update_all" "update_ui";;
@@ -101,7 +106,7 @@ function update_all() {
print_confirm "Everything is already up-to-date!"
echo; break
fi
echo
top_border
echo -e "| The following installations will be updated: |"
@@ -121,6 +126,9 @@ function update_all() {
[[ "${update_arr[*]}" =~ "klipperscreen" ]] && \
echo -e "| ${cyan}● KlipperScreen${white} |"
[[ "${update_arr[*]}" =~ "spoolman" ]] && \
echo -e "| ${cyan}● SpoolMan${white} |"
[[ "${update_arr[*]}" =~ "pgc_for_klipper" ]] && \
echo -e "| ${cyan}● PrettyGCode for Klipper${white} |"
@@ -140,7 +148,7 @@ function update_all() {
echo -e "| ${cyan}● System${white} |"
bottom_border
local yn
read -p "${cyan}###### Do you want to proceed? (Y/n):${white} " yn
case "${yn}" in