|
22 | 22 | # DEALINGS IN THE SOFTWARE. |
23 | 23 |
|
24 | 24 | ######################################################################################### |
25 | | -# Change Log |
26 | | -######################################################################################### |
27 | | - |
28 | | -# 9/24/18 - Updated loop for verifying Apple Setup Complete by Arek Dryer and Kyle Bareis |
29 | | -# * Changed loop to look for the Setup Assistant process rather than files and users |
30 | | -# * Changed /dev/console lookup to stat per shellcheck.net recommendation |
31 | | -# * Verified with 10.13.6, 10.14 and Jamf Pro 10.7.1 |
32 | | -# * Removed double \\ in the new line escapes. Has changed in a recent update. |
33 | | -# * Added a troubleshooting and debugging log for helping out with DEP related issues. |
34 | | -# * Debug log focused on what happens prior to DEP Notify creation. |
35 | | -# * Changed default image to Self Service icon. |
36 | | -# |
37 | | -# 7/13/18 - Major updates to script logic and error correction by Kyle Bareis |
38 | | -# * updated if statements to use true/false over yes/no |
39 | | -# * added FileVault deferred enablement check and modified to logout or continue |
40 | | -# * added tested versions comment |
41 | | -# * additional cleanup and error checking |
42 | | -# 6/28/18 - Initial commit by Kyle Bareis |
43 | | - |
44 | | -######################################################################################### |
45 | | -# Tested Software Versions |
46 | | -######################################################################################### |
47 | | - |
48 | | -# macOS 10.13.6 and macOS 10.4.0 |
49 | | -# DEPNotify 1.1.0 |
50 | | -# Jamf Pro 10.7.1 |
51 | | - |
52 | | -######################################################################################### |
53 | | -# How to Use |
| 25 | +# General Information |
54 | 26 | ######################################################################################### |
55 | 27 |
|
56 | 28 | # This script is designed to make implementation of DEPNotify very easy with limited |
57 | 29 | # scripting knowledge. The section below has variables that may be modified to customize |
58 | 30 | # the end user experience. DO NOT modify things in or below the CORE LOGIC area unless |
59 | 31 | # major testing and validation is performed. |
60 | 32 |
|
61 | | -# The script is set to testing mode by default. Having testing mode on will cause sleep |
62 | | -# commands to be run instead of Policies from Jamf. Also, removal of BOM files that are |
63 | | -# created happen as well to reduce in troubleshooting issues. Finally, Command + Control |
64 | | -# + x is set to quit or interrupt DEP Notify for testing purposes. The script will need |
65 | | -# to be changed from `TESTING_MODE=true` to `TESTING_MODE=false` for polices to run. |
66 | | - |
67 | | -# Overview of Jamf Pro Setup |
68 | | -# 1. Create policies to install core software during first setup. Set the frequency to |
69 | | -# ongoing and the trigger to custom and type in a trigger. Ex: depNotifyFirefox |
70 | | -# 2. Once software policies are created, customize this script with changes to verbiage |
71 | | -# as well as updating the POLICY_ARRAY with appropriate information |
72 | | -# 3. Upload DEP Notify.pkg and this script to Jamf Pro. Create a policy to install the |
73 | | -# PKG and this script using the Enrollment Complete trigger. Also set the |
74 | | -# execution frequency to ongoing. |
75 | | -# 4. Once a computer is finished enrolling, the DEP Notify policy will start and then |
76 | | -# call the other policies in order based on the array. |
77 | | - |
78 | | -# DEP Notify PKG and Documentation can be found at: https://gitlab.com/Mactroll/DEPNotify |
79 | | - |
80 | | -######################################################################################### |
81 | | -# To Do List |
82 | | -######################################################################################### |
83 | | - |
84 | | -# Finalize EULA process - Open issue: https://gitlab.com/Mactroll/DEPNotify/issues/19 |
85 | | -# Create generic registration module |
| 33 | +# More information at: https://github.com/jamfprofessionalservices/DEP-Notify |
86 | 34 |
|
87 | 35 | ######################################################################################### |
88 | 36 | # Variables to Modify |
|
100 | 48 | # If this variable is left blank, the generic image will appear |
101 | 49 | BANNER_IMAGE_PATH="/Applications/Self Service.app/Contents/Resources/AppIcon.icns" |
102 | 50 |
|
| 51 | +# Flag for using the custom branding icon from Self Service and Jamf Pro |
| 52 | +# This will override the banner image specified above |
| 53 | + SELF_SERVICE_CUSTOM_BRANDING=false # Set variable to true or false |
| 54 | + |
103 | 55 | # Main heading that will be displayed under the image |
104 | 56 | # If this variable is left blank, the generic banner will appear |
105 | 57 | BANNER_TITLE="Welcome to Organization" |
|
144 | 96 | ######################################################################################### |
145 | 97 |
|
146 | 98 | # Variables for File Paths |
147 | | - TMP_DEBUG_LOG="/tmp/depNotifyDebug.log" |
148 | 99 | JAMF_BINARY="/usr/local/bin/jamf" |
149 | 100 | FDE_SETUP_BINARY="/usr/bin/fdesetup" |
150 | 101 | DEP_NOTIFY_APP="/Applications/Utilities/DEPNotify.app" |
151 | 102 | DEP_NOTIFY_CONFIG="/var/tmp/depnotify.log" |
152 | 103 | DEP_NOTIFY_DONE="/var/tmp/com.depnotify.provisioning.done" |
153 | 104 | DEP_NOTIFY_EULA="/var/tmp/com.depnotify.agreement.done" |
| 105 | + TMP_DEBUG_LOG="/var/tmp/depNotifyDebug.log" |
154 | 106 |
|
155 | 107 | # Validating true/false flags |
156 | 108 | if [ "$TESTING_MODE" != true ] && [ "$TESTING_MODE" != false ]; then |
|
178 | 130 | CURRENT_USER=$(stat -f "%Su" "/dev/console") |
179 | 131 | echo "$(date "+%a %h %d %H:%M:%S"): Current user set to $CURRENT_USER." >> "$TMP_DEBUG_LOG" |
180 | 132 |
|
| 133 | +# If SELF_SERVICE_CUSTOM_BRANDING is set to true. Loading the updated icon |
| 134 | + if [ "$SELF_SERVICE_CUSTOM_BRANDING" = true ]; then |
| 135 | + open -a "/Applications/Self Service.app" --hide |
| 136 | + |
| 137 | + # Loop waiting on the branding image to properly show in the users library |
| 138 | + CUSTOM_BRANDING_PNG="/Users/$CURRENT_USER/Library/Application Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png" |
| 139 | + until [ -f "$CUSTOM_BRANDING_PNG" ]; do |
| 140 | + echo "$(date "+%a %h %d %H:%M:%S"): Waiting for branding image from Jamf Pro." >> "$TMP_DEBUG_LOG" |
| 141 | + sleep 1 |
| 142 | + done |
| 143 | + |
| 144 | + # Setting Banner Image for DEP Notify to Self Service Custom Branding |
| 145 | + BANNER_IMAGE_PATH="$CUSTOM_BRANDING_PNG" |
| 146 | + fi |
| 147 | + |
181 | 148 | # Testing Mode Enhancements |
182 | 149 | if [ "$TESTING_MODE" = true ]; then |
183 | 150 | # Setting Quit Key set to command + control + x (Testing Mode Only) |
|
0 commit comments