Created
May 5, 2017 17:14
-
-
Save haircut/931b027f6dc546cbd69584d5c6bfd49f to your computer and use it in GitHub Desktop.
From @Elios on macadmins#python
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
#!/usr/bin/python | |
import os | |
import pwd | |
from Foundation import CFPreferencesAppSynchronize | |
from Foundation import CFPreferencesSetValue | |
from Foundation import kCFPreferencesCurrentUser | |
from Foundation import kCFPreferencesCurrentHost | |
uid = pwd.getpwnam('_locationd').pw_uid | |
os.setuid(uid) | |
CFPreferencesSetValue('LocationServicesEnabled', True, 'com.apple.locationd', | |
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment