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:
+11
-8
@@ -69,19 +69,22 @@ menu_tools() {
|
||||
show_prompt
|
||||
read -r choice
|
||||
|
||||
child_rc=0
|
||||
case $choice in
|
||||
1|01) run_sibling "tools/system-infos.sh" ;;
|
||||
2|02) run_sibling "tools/server-benchmark.sh" ;;
|
||||
3|03) run_sibling "tools/harden.sh" ;;
|
||||
4|04) run_sibling "tools/root-password.sh" ;;
|
||||
5|05) run_sibling "tools/update-server.sh" ;;
|
||||
6|06) run_sibling "tools/root-ssh-login.sh" ;;
|
||||
7|07) run_sibling "tools/welcome-message.sh" ;;
|
||||
1|01) run_sibling "tools/system-infos.sh"; child_rc=$? ;;
|
||||
2|02) run_sibling "tools/server-benchmark.sh"; child_rc=$? ;;
|
||||
3|03) run_sibling "tools/harden.sh"; child_rc=$? ;;
|
||||
4|04) run_sibling "tools/root-password.sh"; child_rc=$? ;;
|
||||
5|05) run_sibling "tools/update-server.sh"; child_rc=$? ;;
|
||||
6|06) run_sibling "tools/root-ssh-login.sh"; child_rc=$? ;;
|
||||
7|07) run_sibling "tools/welcome-message.sh"; child_rc=$? ;;
|
||||
0|00) return ;;
|
||||
*) echo -e "${RED}[KO] Invalid protocol. Select 0-7.${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
|
||||
|
||||
Reference in New Issue
Block a user