Skip to content

Instantly share code, notes, and snippets.

@cshepp1211
Created July 29, 2015 20:40
Show Gist options
  • Save cshepp1211/38f9ba90a4fa6e2257e6 to your computer and use it in GitHub Desktop.
Save cshepp1211/38f9ba90a4fa6e2257e6 to your computer and use it in GitHub Desktop.
is-root-enabled
#!/bin/bash
rootCheck=`dscl . read /Users/root | grep AuthenticationAuthority 2>&1 > /dev/null ; echo $?`
if [ "${rootCheck}" == 1 ]; then
echo "<result>Disabled</result>"
else
echo "<result>Enabled</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment