I wanted to check the current gatekeeper status using a bash script preferably to find out whether the status is set to:
1. App Store
2. App Store and identified developers
3. Anywhere
By running below commands will enable Gatekeeper with "App Store" only and but does not help to change it to "App Store and identified developers"
spctl --master-enable
defaults write /Library/Preferences/com.apple.security GKAutoRearm -bool true
Kindly suggest how to achieve both these tasks.