Last active
October 18, 2019 08:47
-
-
Save drewdiver/9ca7ae96a51829f37fd808667644cabf to your computer and use it in GitHub Desktop.
A game of roulette, Cupertino style. Don't get shot...
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 | |
# | |
# Written by Drew Diver 2019 | |
# Create a policy in Jamf to run the following script from Self Service. | |
# | |
# Inspired by https://twitter.com/lapcatsoftware/status/1182350562123227136?s=20 | |
# Named by Armen Briegel | |
import random | |
import subprocess | |
from SystemConfiguration import SCDynamicStoreCopyConsoleUser | |
CURRENT_USER = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0] | |
chamber = [0,0,0,0,0,1] | |
random.shuffle(chamber) | |
if random.choice(chamber): | |
subprocess.call(['sudo', '-u', CURRENT_USER, 'tccutil', 'reset', 'All']) | |
== 1
should not be necessary :]
Good find!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
== 1
should not be necessary :]