Skip to content

Instantly share code, notes, and snippets.

@elvisizer
Created November 30, 2017 19:43
Show Gist options
  • Save elvisizer/58c6029f4d9794d6fd7c236e02ce2df1 to your computer and use it in GitHub Desktop.
Save elvisizer/58c6029f4d9794d6fd7c236e02ce2df1 to your computer and use it in GitHub Desktop.
#!/bin/bash
OS=`sw_vers -productVersion`
result=`what /usr/libexec/opendirectoryd | grep PROJECT | cut -d ":" -f3`
if [[ "$OS" == "10.13.1" ]]; then
if [[ "$result" != "opendirectoryd-483.20.7" ]]; then
result="Not Patched"
else
result="Patched"
fi
elif [[ "$OS" == "10.13.0" ]]; then
if [[ "$result" != "opendirectoryd-483.1.5" ]]; then
result="Not Patched"
else
result="Patched"
fi
else
result="OS not affected"
fi
echo "<result>$result</result>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment