-
Notifications
You must be signed in to change notification settings - Fork 1
clear logs, shell history, ssh keys and networks #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1b66a28
clear logs, shell history, ssh keys and networks
kristapsk 8608f7f
Describe how to calculate correct mount offset for 2nd partition of S…
kristapsk 6cc09ed
CI: Install whois (for mkpasswd)
kristapsk ae94981
Proper escaping for generated encrypted password hashes
kristapsk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Default configuration file for wpa_supplicant.conf(5). | ||
|
||
ctrl_interface=/run/wpa_supplicant | ||
ctrl_interface_group=wheel | ||
eapol_version=1 | ||
ap_scan=1 | ||
fast_reauth=1 | ||
update_config=1 | ||
passive_scan=1 | ||
|
||
# Add here your networks. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,6 +292,15 @@ run_main() | |
echo "done." | ||
fi | ||
|
||
# clear logs, shell history, ssh keys and networks | ||
echo -n "Clearing logs, shell history, ssh keys and networks ... " | ||
rm -f "$USD_MOUNT_POINT"/var/log/* 2> /dev/null | ||
for d in "$USD_MOUNT_POINT"/var/log/socklog/*; do echo > "$d/current"; done | ||
rm "$USD_MOUNT_POINT"/root/.bash_history | ||
echo > "$USD_MOUNT_POINT"/root/.ssh/authorized_keys | ||
cp "$(dirname "$0")"/../rootfiles/etc/wpa_supplicant/wpa_supplicant.conf "$USD_MOUNT_POINT"/etc/wpa_supplicant/wpa_supplicant.conf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid brittle relative paths for config copy. Relying on
🤖 Prompt for AI Agents
|
||
echo "done." | ||
|
||
sync | ||
echo "All DONE, Nakamochi uSD and SSD should be ready!" | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use recursive and safe log cleanup.
The command
only removes top-level files and leaves directories intact. For a complete wipe of log contents, consider:
This ensures all files in subdirectories are also removed and guards against globbing errors.
🤖 Prompt for AI Agents