Add history cleaning prompt on exit

Changes:
- Prompt user to clean history when selecting Exit (0)
- Runs trace eraser if user answers 'yes'
- Shows clear message about what will be cleaned

User experience:
- Exit from main menu
- Asked: 'Clean history? (yes/no)'
- If yes: runs full trace eraser
- Then exits normally
This commit is contained in:
cschantz
2025-11-11 17:44:42 -05:00
parent 642a7dda7f
commit db352cc7a2
+10
View File
@@ -1503,6 +1503,16 @@ main() {
9) edit_config ;; 9) edit_config ;;
10) bash "$BASE_DIR/tools/erase-toolkit-traces.sh" ;; 10) bash "$BASE_DIR/tools/erase-toolkit-traces.sh" ;;
0) 0)
echo ""
echo -e "${YELLOW}Clean bash history before exiting?${NC}"
echo "This will remove all toolkit-related commands from history."
echo ""
read -p "Clean history? (yes/no): " clean_hist
if [ "$clean_hist" = "yes" ]; then
bash "$BASE_DIR/tools/erase-toolkit-traces.sh"
fi
echo "" echo ""
echo -e "${GREEN}Thanks for using Server Management Toolkit!${NC}" echo -e "${GREEN}Thanks for using Server Management Toolkit!${NC}"
echo "" echo ""