Skip to content

Instantly share code, notes, and snippets.

@grahamgilbert
Created August 3, 2016 06:23
Show Gist options
  • Save grahamgilbert/4f203157a7463ee602493216871ac370 to your computer and use it in GitHub Desktop.
Save grahamgilbert/4f203157a7463ee602493216871ac370 to your computer and use it in GitHub Desktop.
Enable Auto TimeZone
#!/bin/bash
/bin/launchctl unload /System/Library/LaunchDaemons/com.apple.locationd.plist
uuid=`/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57`
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1
/usr/sbin/chown -R _locationd:_locationd /var/db/locationd
/bin/launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist
/usr/sbin/systemsetup -setusingnetworktime on
/bin/rm -f /Library/Preferences/com.apple.timezone.auto.plist
/usr/bin/defaults write /Library/Preferences/com.apple.timezone.auto Active -bool true
/usr/bin/plutil -convert xml1 /Library/Preferences/com.apple.timezone.auto.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment