refactor: update update_menu.sh and update functions

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-04-12 16:02:48 +02:00
parent 02e49edd08
commit 077cb1654a
10 changed files with 207 additions and 181 deletions

View File

@@ -1,56 +1,3 @@
update_all(){
while true; do
if [ "${#update_arr[@]}" = "0" ]; then
CONFIRM_MSG="Everything is already up to date!"
echo; break
fi
echo
top_border
echo -e "| The following installations will be updated: |"
if [ "$KLIPPER_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Klipper${white} |"
fi
if [ "$MOONRAKER_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Moonraker${white} |"
fi
if [ "$MAINSAIL_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Mainsail${white} |"
fi
if [ "$FLUIDD_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Fluidd${white} |"
fi
if [ "$KLIPPERSCREEN_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● KlipperScreen${white} |"
fi
if [ "$PGC_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● PrettyGCode for Klipper${white} |"
fi
if [ "$MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● MoonrakerTelegramBot${white} |"
fi
if [ "$SYS_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● System${white} |"
fi
bottom_border
if [ "${#update_arr[@]}" != "0" ]; then
read -p "${cyan}###### Do you want to proceed? (Y/n):${white} " yn
case "$yn" in
Y|y|Yes|yes|"")
for update in ${update_arr[@]}
do
$update
done
break;;
N|n|No|no)
break;;
*)
print_unkown_cmd
print_msg && clear_msg;;
esac
fi
done
}
update_log_paths(){
### update services to make use of moonrakers new log_path option
### https://github.com/Arksine/moonraker/commit/829b3a4ee80579af35dd64a37ccc092a1f67682a