refactor(nav): use exit code 75 to suppress redundant "Press Enter" prompt
- app submenus return 75 on back/exit instead of 0 - index menus capture child exit code and skip pause when rc is 75 - applies to apps (coolify, pterodactyl, uptime-kuma, cloudpanel, proxmox) and tools (server-benchmark, system-infos) indexes
This commit is contained in:
+1
-1
@@ -637,7 +637,7 @@ main() {
|
||||
2) update_cloudpanel ;;
|
||||
3) show_status ;;
|
||||
4) configure_rclone_backblaze ;;
|
||||
0) return 0 ;;
|
||||
0) return 75 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ main() {
|
||||
2) update_coolify ;;
|
||||
3) show_status ;;
|
||||
4) show_post_installation_guide ;;
|
||||
0) return 0 ;;
|
||||
0) return 75 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
|
||||
|
||||
+9
-6
@@ -66,17 +66,20 @@ menu_apps() {
|
||||
show_prompt
|
||||
read -r choice
|
||||
|
||||
child_rc=0
|
||||
case $choice in
|
||||
1|01) run_sibling "apps/coolify.sh" ;;
|
||||
2|02) run_sibling "apps/pterodactyl.sh" ;;
|
||||
3|03) run_sibling "apps/uptime-kuma.sh" ;;
|
||||
4|04) run_sibling "apps/cloudpanel.sh" ;;
|
||||
5|05) run_sibling "apps/proxmox.sh" ;;
|
||||
1|01) run_sibling "apps/coolify.sh"; child_rc=$? ;;
|
||||
2|02) run_sibling "apps/pterodactyl.sh"; child_rc=$? ;;
|
||||
3|03) run_sibling "apps/uptime-kuma.sh"; child_rc=$? ;;
|
||||
4|04) run_sibling "apps/cloudpanel.sh"; child_rc=$? ;;
|
||||
5|05) run_sibling "apps/proxmox.sh"; child_rc=$? ;;
|
||||
0|00) return ;;
|
||||
*) echo -e "${RED}[KO] Invalid protocol. Select 0-5.${NC}"; sleep 1; continue ;;
|
||||
esac
|
||||
|
||||
if [ "$choice" != "0" ] && [ "$choice" != "00" ]; then
|
||||
# Exit code 75 from a child means it already paused on its own
|
||||
# (its own "Back" or end-of-run prompt) — skip the redundant prompt.
|
||||
if [ "$child_rc" -ne 75 ]; then
|
||||
echo ""
|
||||
read -r -p "Press Enter to continue..."
|
||||
fi
|
||||
|
||||
+1
-1
@@ -371,7 +371,7 @@ main() {
|
||||
7) update_proxmox ;;
|
||||
8) clear_cache ;;
|
||||
9) open_firewall_ports ;;
|
||||
0) return 0 ;;
|
||||
0) return 75 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
|
||||
|
||||
+1
-1
@@ -323,7 +323,7 @@ main() {
|
||||
case $choice in
|
||||
1) install_pterodactyl ;;
|
||||
2) show_status ;;
|
||||
0) return 0 ;;
|
||||
0) return 75 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ main() {
|
||||
1) install_uptime_kuma ;;
|
||||
2) update_uptime_kuma ;;
|
||||
3) show_status ;;
|
||||
0) return 0 ;;
|
||||
0) return 75 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user