From 97808ea1a41f5571013df898a011374c2bb9757f Mon Sep 17 00:00:00 2001 From: Evgenii Date: Sat, 11 Sep 2021 01:05:01 +0300 Subject: [PATCH 1/3] Revert "Update status.sh" This reverts commit 89dc6d2d14dae5cd86b3a0f373221413ccc8e741. --- scripts/status.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/status.sh b/scripts/status.sh index cee1b04..3633e42 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -99,7 +99,7 @@ moonraker_status(){ ) ### count amount of moonraker service files in /etc/systemd/system - SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E 'moonraker\.service|moonraker-[[:digit:]]*.service' | wc -l) + SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "moonraker" | wc -l) ### remove the "SERVICE" entry from the moonraker_data array if a moonraker service is installed [ $SERVICE_FILE_COUNT -gt 0 ] && unset moonraker_data[0] From 68327262fc3fae17ad0327a5df6b2c280bef57ca Mon Sep 17 00:00:00 2001 From: "AKA \"Thom Wiley" Date: Sun, 12 Sep 2021 14:41:27 -0400 Subject: [PATCH 2/3] chore: change submenu "quit" to "back" Changing the "Quit" option to "Back" as it is more intuitive, causes less confusion and is in fact the more fitting description of what is happening. --- scripts/ui/advanced_menu.sh | 16 ++++++++-------- scripts/ui/backup_menu.sh | 6 +++--- scripts/ui/general_ui.sh | 8 +++++++- scripts/ui/install_menu.sh | 4 ++-- scripts/ui/remove_menu.sh | 4 ++-- scripts/ui/settings_menu.sh | 4 ++-- scripts/ui/update_menu.sh | 4 ++-- scripts/upload_log.sh | 4 ++-- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/scripts/ui/advanced_menu.sh b/scripts/ui/advanced_menu.sh index 98ce539..b227d22 100755 --- a/scripts/ui/advanced_menu.sh +++ b/scripts/ui/advanced_menu.sh @@ -18,7 +18,7 @@ advanced_ui(){ echo -e "| 6) [Get MCU ID] | | " echo -e "| | CustomPiOS: | " echo -e "| | 10) [Migration Helper] | " -quit_footer +back_footer } advanced_menu(){ @@ -72,7 +72,7 @@ advanced_menu(){ do_action "setup_gcode_shell_command" "advanced_ui";; 10) do_action "migration_menu";; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "advanced_ui";; @@ -99,7 +99,7 @@ switch_ui(){ echo -e "| dmbutyugin: | " echo -e "| 2) [--> scurve-shaping] | " echo -e "| 3) [--> scurve-smoothing] | " - quit_footer + back_footer } switch_menu(){ @@ -137,7 +137,7 @@ switch_menu(){ read_branch print_msg && clear_msg switch_ui;; - Q|q) + B|b) clear; advanced_menu; break;; *) deny_action "switch_ui";; @@ -167,7 +167,7 @@ rollback_ui(){ hr echo -e "| Commit last updated from: | " echo -e "| $PREV_UI | " - quit_footer + back_footer } ############################################################# @@ -190,7 +190,7 @@ migration_ui(){ echo -e "| 1) [Migrate MainsailOS] | " echo -e "| 2) [Migrate FluiddPi] | " echo -e "| | " - quit_footer + back_footer } migration_menu(){ @@ -201,8 +201,8 @@ migration_menu(){ case "$action" in 1) migrate_custompios "mainsail"; migration_menu;; 2) migrate_custompios "fluiddpi"; migration_menu;; - Q|q) clear; advanced_menu; break;; + B|b) clear; advanced_menu; break;; *) print_unkown_cmd; migration_menu;; esac done -} \ No newline at end of file +} diff --git a/scripts/ui/backup_menu.sh b/scripts/ui/backup_menu.sh index 16755a1..231176c 100755 --- a/scripts/ui/backup_menu.sh +++ b/scripts/ui/backup_menu.sh @@ -14,7 +14,7 @@ backup_ui(){ echo -e "| 2) [Moonraker] | Other: | " echo -e "| 3) [Moonraker DB] | 7) [Duet Web Control] | " echo -e "| | 8) [OctoPrint] | " - quit_footer + back_footer } backup_menu(){ @@ -40,11 +40,11 @@ backup_menu(){ do_action "backup_dwc2" "backup_ui";; 8) do_action "backup_octoprint" "backup_ui";; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "backup_ui";; esac done backup_menu -} \ No newline at end of file +} diff --git a/scripts/ui/general_ui.sh b/scripts/ui/general_ui.sh index f34d37a..a2d7d0b 100755 --- a/scripts/ui/general_ui.sh +++ b/scripts/ui/general_ui.sh @@ -21,6 +21,12 @@ quit_footer(){ bottom_border } +back_footer(){ + hr + echo -e "| ${green}B) Back${default} | " + bottom_border +} + print_header(){ top_border echo -e "| $(title_msg "~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~") |" @@ -60,4 +66,4 @@ deny_action(){ print_unkown_cmd print_msg && clear_msg $1 -} \ No newline at end of file +} diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index 8bcd528..40978b8 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -17,7 +17,7 @@ install_ui(){ echo -e "| 4) [Fluidd] | Webcam: | " echo -e "| | 9) [MJPG-Streamer] | " echo -e "| | | " - quit_footer + back_footer } install_menu(){ @@ -43,7 +43,7 @@ install_menu(){ do_action "install_pgc_for_klipper" "install_ui";; 9) do_action "install_mjpg-streamer" "install_ui";; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "install_ui";; diff --git a/scripts/ui/remove_menu.sh b/scripts/ui/remove_menu.sh index 873674a..83d39fc 100755 --- a/scripts/ui/remove_menu.sh +++ b/scripts/ui/remove_menu.sh @@ -17,7 +17,7 @@ remove_ui(){ echo -e "| 3) [Mainsail] | 9) [PrettyGCode] | " echo -e "| 4) [Fluidd] | | " echo -e "| | 10) [NGINX] | " - quit_footer + back_footer } remove_menu(){ @@ -45,7 +45,7 @@ remove_menu(){ do_action "remove_prettygcode" "remove_ui";; 10) do_action "remove_nginx" "remove_ui";; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "remove_ui";; diff --git a/scripts/ui/settings_menu.sh b/scripts/ui/settings_menu.sh index 1c06c70..0537941 100755 --- a/scripts/ui/settings_menu.sh +++ b/scripts/ui/settings_menu.sh @@ -20,7 +20,7 @@ settings_ui(){ else echo -e "| 1) Change config folder | " fi - quit_footer + back_footer } settings_menu(){ @@ -34,7 +34,7 @@ settings_menu(){ else deny_action "settings_ui" fi;; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "settings_ui";; diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 7fe52a6..26fb096 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -24,7 +24,7 @@ update_ui(){ echo -e "| 8) [PrettyGCode] | $LOCAL_PGC_COMMIT | $REMOTE_PGC_COMMIT | " echo -e "| |------------------------------| " echo -e "| 9) [System] | $DISPLAY_SYS_UPDATE | " - quit_footer + back_footer } update_menu(){ @@ -55,7 +55,7 @@ update_menu(){ do_action "update_system" "update_ui";; a) do_action "update_all" "update_ui";; - Q|q) + B|b) clear; main_menu; break;; *) deny_action "update_ui";; diff --git a/scripts/upload_log.sh b/scripts/upload_log.sh index 03d3584..e2a03b2 100755 --- a/scripts/upload_log.sh +++ b/scripts/upload_log.sh @@ -71,7 +71,7 @@ upload_selection(){ printf "| $i) %-50s|\n" "${logfiles[$i]}" i=$((i + 1)) done - quit_footer + back_footer while true; do read -p "${cyan}Please select:${default} " choice if [ $choice = "q" ] || [ $choice = "Q" ]; then @@ -101,4 +101,4 @@ upload_log(){ ERROR_MSG="File not found!" && print_msg && clear_msg upload_selection fi -} \ No newline at end of file +} From 65bf3d5251b2442677c1f0b49d3e52bccaae8b86 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 12 Sep 2021 20:46:11 +0200 Subject: [PATCH 3/3] fix: fix of previous commit and small refactor --- scripts/ms_theme_installer.sh | 4 ++-- scripts/rollback.sh | 21 ++++++++++++++++++++- scripts/ui/advanced_menu.sh | 22 ---------------------- scripts/upload_log.sh | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/scripts/ms_theme_installer.sh b/scripts/ms_theme_installer.sh index 568931d..675b9fd 100755 --- a/scripts/ms_theme_installer.sh +++ b/scripts/ms_theme_installer.sh @@ -38,14 +38,14 @@ ms_theme_ui(){ echo -e "| | " echo -e "| R) [Remove Theme] | " #echo -e "| | " - quit_footer + back_footer } ms_theme_menu(){ ms_theme_ui while true; do read -p "${cyan}Install theme:${default} " a; echo - if [ $a = "q" ] || [ $a = "Q" ]; then + if [ $a = "b" ] || [ $a = "B" ]; then clear && advanced_menu && break elif [ $a = "r" ] || [ $a = "R" ]; then ms_theme_delete diff --git a/scripts/rollback.sh b/scripts/rollback.sh index 79a6482..531d9ed 100755 --- a/scripts/rollback.sh +++ b/scripts/rollback.sh @@ -50,6 +50,25 @@ load_klipper_state(){ rollback_klipper } +rollback_ui(){ + top_border + echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | " + hr + echo -e "| If serious errors occured after updating Klipper, | " + echo -e "| you can use this menu to return to the previously | " + echo -e "| used commit from which you have updated. | " + bottom_border + top_border + echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | " + hr + echo -e "| Currently on commit: | " + echo -e "| $CURR_UI | " + hr + echo -e "| Commit last updated from: | " + echo -e "| $PREV_UI | " + back_footer +} + rollback_klipper(){ if [ "$PREVIOUS_COMMIT" != "0" ] && [ "$CURRENT_COMMIT" != "$PREVIOUS_COMMIT" ]; then while true; do @@ -66,7 +85,7 @@ rollback_klipper(){ load_klipper_state break;; N|n|No|no) clear; advanced_menu; break;; - Q|q) clear; advanced_menu; break;; + B|b) clear; advanced_menu; break;; *) print_unkown_cmd print_msg && clear_msg;; diff --git a/scripts/ui/advanced_menu.sh b/scripts/ui/advanced_menu.sh index b227d22..f5f6f59 100755 --- a/scripts/ui/advanced_menu.sh +++ b/scripts/ui/advanced_menu.sh @@ -151,28 +151,6 @@ switch_menu(){ ############################################################# ############################################################# -rollback_ui(){ - top_border - echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | " - hr - echo -e "| If serious errors occured after updating Klipper, | " - echo -e "| you can use this menu to return to the previously | " - echo -e "| used commit from which you have updated. | " - bottom_border - top_border - echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | " - hr - echo -e "| Currently on commit: | " - echo -e "| $CURR_UI | " - hr - echo -e "| Commit last updated from: | " - echo -e "| $PREV_UI | " - back_footer -} - -############################################################# -############################################################# - migration_ui(){ top_border echo -e "| $(title_msg "~~~~~~~~~ [ CustomPiOS Migration ] ~~~~~~~~~~") | " diff --git a/scripts/upload_log.sh b/scripts/upload_log.sh index e2a03b2..7c2234b 100755 --- a/scripts/upload_log.sh +++ b/scripts/upload_log.sh @@ -74,7 +74,7 @@ upload_selection(){ back_footer while true; do read -p "${cyan}Please select:${default} " choice - if [ $choice = "q" ] || [ $choice = "Q" ]; then + if [ $choice = "b" ] || [ $choice = "B" ]; then clear && main_menu && break elif [ $choice -le ${#logfiles[@]} ]; then upload_log "${logfiles[$choice]}"