SSH Dels
This commit is contained in:
parent
e3eba24f7e
commit
a738e2119e
1 changed files with 1 additions and 3 deletions
|
@ -11,13 +11,11 @@ function ssh-del-name {
|
||||||
local host_name
|
local host_name
|
||||||
set -u
|
set -u
|
||||||
host_name=${1}
|
host_name=${1}
|
||||||
|
|
||||||
sed -n "/${host_name}/p" ~/.ssh/known_hosts
|
sed -n "/${host_name}/p" ~/.ssh/known_hosts
|
||||||
printf "Delete the above? (y/n)"
|
printf "Delete the above? (y/n)"
|
||||||
read -q resp
|
read -q resp
|
||||||
|
|
||||||
if [[ "y" == "${resp}" ]]; then
|
if [[ "y" == "${resp}" ]]; then
|
||||||
sed -n -i.bak "/${host_name}/d" ~/.ssh/known_hosts
|
sed -i.bak "/${host_name}/d" ~/.ssh/known_hosts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +u
|
set +u
|
||||||
|
|
Loading…
Add table
Reference in a new issue