Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #11 from scifiman/master
Browse files Browse the repository at this point in the history
FIXME: Bug Fixes (Issues #9 and #10)
  • Loading branch information
SMartorelli authored Jan 18, 2021
2 parents 3950d18 + 275c658 commit 7700aa4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/enrollmentSample.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
import urllib2
import base64
import sys
import json

# Get the logged in user
loggedInUser = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]
loggedInUser = [loggedInUser,""][loggedInUser in [u"loginwindow", None, u""]]

print "logged in user is: %s" % loggedInUser
fileUserPath="/Users/%s/Library/Preferences/com.ibm.enrollment.plist." % loggedInUser
fileUserPath="/Users/%s/Library/Preferences/com.ibm.enrollment.plist" % loggedInUser

# Setup for enrollment
if os.path.exists(fileUserPath):
Expand All @@ -29,6 +30,7 @@
# sys arguements are pulled from script parameters in the jss
'''
jss_url = sys.argv[4]
jss_url = jss_url.rstrip('/')
jss_api_user = sys.argv[5]
jss_api_passwd = sys.argv[6]
Expand Down Expand Up @@ -65,6 +67,5 @@
sub_command = ['sudo', '-u', loggedInUser, 'defaults', 'write', fileUserPath, key, value]
ssUser = subprocess.Popen(sub_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)


# Launch the enrollment application
os.system("open /Applications/Enrollment.app")

0 comments on commit 7700aa4

Please sign in to comment.