Skip to content

Instantly share code, notes, and snippets.

@zvyn
Created January 22, 2014 10:47
Show Gist options
  • Save zvyn/8556769 to your computer and use it in GitHub Desktop.
Save zvyn/8556769 to your computer and use it in GitHub Desktop.
function ssh_no_memory() {
command ssh $*
echo -n "Remove "
tail -1 $HOME/.ssh/known_hosts | cut -d' ' -f1 | tr -d '\n'
echo " from known hosts?"
read yesno
case $yesno in
Y|y|Yes|yes|YES|Nagut|Jo|Jepp|Jadoch|klar)
sed -i '$ d' $HOME/.ssh/known_hosts
;;
esac
}
if [ ! $__NAME__ ]; then
__NAME__=$(basename --suffix=.bash $0)
if [[ $(type -t ${__NAME__}) == function ]]; then
${__NAME__} $0 $*
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment