Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created February 19, 2017 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/cc0d3a320bdf7c91fc957945a5382337 to your computer and use it in GitHub Desktop.
Save oxagast/cc0d3a320bdf7c91fc957945a5382337 to your computer and use it in GitHub Desktop.
#!/bin/bash
# alias "git"='~/.git_check_rsa.sh'
if [ "$(find . -type f 2>/dev/null | xargs head -n 1 2>/dev/null | grep 'BEGIN RSA' | head -n 1 2>/dev/null)" == "-----BEGIN RSA PRIVATE KEY-----" ]; then
echo RSA KEY FOUND!;
echo Not adding to git.;
exit 1;
else
git $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment