Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Add Auto System & App Store Updates
Browse files Browse the repository at this point in the history
See #17
  • Loading branch information
0xmachos committed Jan 21, 2019
1 parent c9e779d commit eaf21d5
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,42 @@
Easy to read, non one-liner, version of all the `audit` and `fix` commands used by mOSL.


## Enable Automatic Updates
## Enable Automatic System Updates

### Audit
```
sudo softwareupdate --schedule | grep -q 'Automatic check is on'
if ! defaults read "/Library/Preferences/com.apple.SoftwareUpdate.plist" "AutomaticallyInstallMacOSUpdates" >/dev/null 2>&1; then
exit 1
# This key isnt present if the user has not manually interacted with System Preferences > Software Update before
fi
defaults read "/Library/Preferences/com.apple.SoftwareUpdate.plist" "AutomaticallyInstallMacOSUpdates" | grep -q "1"
```

### Fix
```
sudo softwareupdate --schedule on
declare -a keys
keys=(AutomaticCheckEnabled AutomaticDownload AutomaticallyInstallMacOSUpdates ConfigDataInstall CriticalUpdateInstall)
for key in "${keys[@]}"; do
defaults write "/Library/Preferences/com.apple.SoftwareUpdate.plist" "${key}" -bool true
done
```

## Enable Automatic App Store Updates

### Audit
```
if ! defaults read "/Library/Preferences/com.apple.commerce.plist" "AutoUpdate" >/dev/null 2>&1; then
exit 1
fi
defaults read "/Library/Preferences/com.apple.commerce.plist" "AutoUpdate" >/dev/null 2>&1 | grep -q '0';
```

### Fix
```
defaults write "/Library/Preferences/com.apple.commerce.plist" "AutoUpdate" -bool true
```

## Enable Gatekeeper
Expand Down

0 comments on commit eaf21d5

Please sign in to comment.