Created
May 30, 2014 20:16
-
-
Save triti/6fbb9900a406579eb394 to your computer and use it in GitHub Desktop.
Absolute Manage custom information field to display whether Gatekeeper is enabled or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/6fbb9900a406579eb394 | |
# Absolute Manage custom information field to display the current Gatekeeper | |
# status. Based on the script by Rich Trouton | |
# https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/check_gatekeeper_status/check_gatekeeper_status.sh | |
result='' | |
os_version="$(/usr/bin/sw_vers -productVersion | awk -F. '{print $2}')" | |
if [[ "${os_version}" -ge 7 ]]; then | |
gatekeeper_status="$(/usr/sbin/spctl --status | /usr/bin/awk '/assessments/ { print $2; }')" | |
if [[ "${gatekeeper_status}" = 'disabled' ]]; then | |
result='No' | |
else | |
result='Yes' | |
fi | |
fi | |
echo "${result}" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment