Destroy session on any non-zero exit code #2

Merged
ben merged 1 commits from tomasino/SLBR:master into master 3 years ago
  1. 12
      suicidebash.bashrc

12
suicidebash.bashrc

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

does this need export?

does this need `export`?

Loading…
Cancel
Save