-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdep_waitToFire.sh
More file actions
21 lines (14 loc) · 867 Bytes
/
dep_waitToFire.sh
File metadata and controls
21 lines (14 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Starting state user and find the jamf binary
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
jamf=$(which jamf)
# Check if:
# - User is in control (not _mbsetupuser)
until [ "$loggedInUser" != "_mbsetupuser" ]
do
sleep 2
# Recheck user
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
done
"$jamf" policy -event dep_setup -randomDelaySeconds 0
exit 0