FIX: Exit menu confirmation prompt not displaying
- Separate prompt display from read command - Print prompt to stderr before attempting read - Show thanks message even if read fails - Ensures exit menu always displays something to user Impact: Exit confirmation prompt now properly visible when user selects option 0.
This commit is contained in:
+7
-2
@@ -815,8 +815,13 @@ main() {
|
|||||||
7) run_module "maintenance" "cleanup-toolkit-data.sh" ;;
|
7) run_module "maintenance" "cleanup-toolkit-data.sh" ;;
|
||||||
0)
|
0)
|
||||||
echo ""
|
echo ""
|
||||||
if ! read -p "Clean history and remove traces? (yes/no): " clean_hist </dev/tty 2>/dev/null; then
|
echo "Clean history and remove traces? (yes/no): " >&2
|
||||||
return 0 # Exit if read fails
|
if ! read -r clean_hist </dev/tty 2>/dev/null; then
|
||||||
|
# Exit if read fails - just assume no cleanup
|
||||||
|
echo ""
|
||||||
|
echo "Thanks for using Server Management Toolkit!"
|
||||||
|
echo ""
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$clean_hist" = "yes" ]; then
|
if [ "$clean_hist" = "yes" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user