User bash history cleaning is now optional with a prompt, since most users only work as root.
Changes:
• Added user count detection
• Prompts: "Clean user bash histories too? (y/n) [n]"
• Default is "no" (skip user histories)
• If no users exist, automatically skips
• Only cleans root history by default (faster, covers 99% of use cases)
This makes the script faster and more sensible for typical usage where only root is used to run the toolkit.
The trace eraser was failing with "no previous regular expression" sed errors and wasn't effectively cleaning bash history.
Problems fixed:
• Broken sed pattern matching (caused errors, unreliable)
• Pattern-based deletion doesn't catch all toolkit usage
• In-memory history wasn't being cleared
New approach:
• Simply removes last 50 entries from bash history files
• More reliable than pattern matching (catches downloads, usage, everything)
• Clears in-memory history with history -c && history -w
• Creates .bak backup before cleaning
• Handles both root and user histories
• Changed system log cleaning from sed to grep -v (more reliable)
• Added symlink check for log files
This ensures the last 50 commands (covering toolkit download, installation, and usage) are completely removed from bash history.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- New tool: erase-toolkit-traces.sh removes all toolkit traces
- Cleans bash history for all users
- Removes toolkit mentions from system logs
- Deletes download artifacts and temp files
- Optional: complete toolkit directory removal
- Added to main menu as option 10