Skip to content

Instantly share code, notes, and snippets.

@vena
Last active January 14, 2017 18:07
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 vena/3b0eb88cd54f4a9b1782076b7a59f20b to your computer and use it in GitHub Desktop.
Save vena/3b0eb88cd54f4a9b1782076b7a59f20b to your computer and use it in GitHub Desktop.
easy dis/enabling gatekeeper in macOS 10.12. a tiny script i put in /usr/local/bin, filename "gatekeeper" so i don't have to remember spctl, just "gatekeeper on" and "gatekeeper off"
#!/bin/bash
# Allows easily dis/enabling gatekeeper
# Place in /usr/local/bin/ for easy-access,
# don't forget to chmod +x
case "$1" in
on)
sudo spctl --master-enable
sleep 0.25
sudo spctl --status
;;
off)
sudo spctl --master-disable
sleep 0.25
sudo spctl --status
;;
*)
echo $"Usage: $0 {on|off}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment