mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: finalize initial modules, some qol changes
This commit is contained in:
parent
27679d38fd
commit
e8c405b3f1
45 changed files with 632 additions and 470 deletions
11
scripts/sshrm.sh
Normal file
11
scripts/sshrm.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
HISTFILE="$HOME"/.histfile
|
||||
|
||||
last_ssh_cmd=$(grep -E "ssh " "$HISTFILE" | sed -E 's/^: [0-9]+:[0-9]+;//' | grep "^ssh " | tail -1)
|
||||
host=$(echo "$last_ssh_cmd" | sed -E 's/.*ssh ([^@ ]+@)?([^ ]+).*/\2/')
|
||||
|
||||
if [[ -n $host ]]; then
|
||||
echo "Removing SSH host key for: $host"
|
||||
ssh-keygen -R "$host"
|
||||
else
|
||||
echo "No valid SSH command found in history."
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue