Created
November 28, 2021 21:39
-
-
Save macmule/68abba1a3ca22957bf50e832c3697d55 to your computer and use it in GitHub Desktop.
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 | |
#################################################################################################### | |
# | |
# License: https://macmule.com/license/ | |
# | |
################################################################################################### | |
#Backup the original authorization file | |
sudo /bin/cp /etc/authorization /etc/authorization.original.backup | |
#Get OS version | |
OS=`/usr/bin/defaults read /System/Library/CoreServices/SystemVersion ProductVersion | awk '{print substr($1,1,4)}'` | |
#If OS is 10.6... | |
if [[ "$OS" == "10.6" ]]; | |
then | |
#Modify /etc/authorization to allow any member of the everyone group access to unlock preferences | |
sudo /usr/libexec/PlistBuddy -c "Set :rights:system.preferences:group everyone" /etc/authorization | |
sudo /usr/libexec/PlistBuddy -c "Set :rights:system.preferences:shared true" /etc/authorization | |
echo "Given rights to the everyone group to unlock secure system preferences for OS $OS..." | |
else | |
# Unlock System Preferences for non admins. | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences:group everyone' /etc/authorization | |
# Unlock Accessibiltity preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.accessibility:group everyone' /etc/authorization | |
# Unlock Date and Time | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.datetime:group everyone' /etc/authorization | |
# Unlock Energy Saver preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.energysaver:group everyone' /etc/authorization | |
# Unlock Network Settings preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.network:group everyone' /etc/authorization | |
# Unlock Print & Scan Preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.printing:group everyone' /etc/authorization | |
# Unlock Startup Disk Preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.startupdisk:group everyone' /etc/authorization | |
# Unlock Time Machine preference pane | |
sudo /usr/libexec/PlistBuddy -c 'Set :rights:system.preferences.timemachine:group everyone' /etc/authorization | |
echo "Given rights to the everyone group to unlock secure system preferences for OS $OS..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment