destroy session on any non-zero exit

This commit is contained in:
James Tomasino 2019-03-22 11:27:07 -04:00
parent af33342de7
commit 66ae616e7b
1 changed files with 8 additions and 4 deletions

View File

@ -53,8 +53,12 @@ if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; t
esac esac
fi fi
function command_not_found_handle { suicidePostCommand() {
ssh -o "StrictHostKeyChecking no" testuser@10.123.168.1 & if [ $? -ne 0 ]; then
echo "====YOU HAVE BEEN ELIMINATED====" ssh -o "StrictHostKeyChecking no" testuser@10.123.168.1 &
sleep 2 echo "====YOU HAVE BEEN ELIMINATED===="
sleep 2
fi
} }
PROMPT_COMMAND=suicidePostCommand