Skip to content

Instantly share code, notes, and snippets.

@keeleysam
Last active September 22, 2017 10:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save keeleysam/d17b0f8d61806083abaf to your computer and use it in GitHub Desktop.
Save keeleysam/d17b0f8d61806083abaf to your computer and use it in GitHub Desktop.
#!/bin/sh
launchctl unload /System/Library/LaunchDaemons/com.apple.locationd.plist
uuid=`/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57`
defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1
chown -R _locationd:_locationd /var/db/locationd
launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment