Add code
This commit is contained in:
parent
9062a8f1e1
commit
61d0250fd9
14
sshrm
Executable file
14
sshrm
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -r FILENAME="${HOME}/.ssh/known_hosts"
|
||||
declare HOST=""
|
||||
|
||||
if [ ! "${1}" == "" ]; then
|
||||
case ${1} in
|
||||
*[!0-9]*) HOST=$(sed -n -e "${1}"p "${FILENAME}" | awk '{print $1}') ;;
|
||||
*) HOST=${1} ;;
|
||||
esac
|
||||
ssh-keygen -R "${HOST}"
|
||||
else
|
||||
echo "Error: No IP or line number provided !"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user