SHA256
1
0
Files
deploy/roles/scripts/history-clean
2026-01-29 02:49:52 -05:00

8 lines
279 B
Bash
Executable File

#!/usr/bin/env bash
# Cleans the history file of PGP messages and keys
histfile="${1:-$HISTFILE:-$HOME/.histfile}"
cp -a "$histfile" "/tmp/$histfile.bak"
sed --in-place '/gpg/d' "$histfile"
sed --in-place '/-----BEGIN PGP MESSAGE-----/,/-----END PGP MESSAGE-----/d' "$histfile"