Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check bannerImage & welcomeBannerImage #21

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Setup-Your-Mac-via-Dialog.bash
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,14 @@ welcomeBannerText="Happy $( date +'%A' ), ${loggedInUserFirstname} and welcome t
welcomeCaption="Please review the above video, then click Continue."
welcomeVideoID="vimeoid=812753953"

# Check if the custom welcomeBannerImage is available, and if not, use a alternative image
if curl --output /dev/null --silent --head --fail "$welcomeBannerImage"; then
echo "welcomeBannerImage is available"
amadotejada marked this conversation as resolved.
Show resolved Hide resolved
else
echo "welcomeBannerImage is not available, using alternative image"
amadotejada marked this conversation as resolved.
Show resolved Hide resolved
welcomeBannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg"
fi

# Welcome icon set to either light or dark, based on user's Apperance setting (thanks, @mm2270!)
appleInterfaceStyle=$( /usr/bin/defaults read /Users/"${loggedInUser}"/Library/Preferences/.GlobalPreferences.plist AppleInterfaceStyle 2>&1 )
if [[ "${appleInterfaceStyle}" == "Dark" ]]; then
Expand Down Expand Up @@ -524,6 +532,14 @@ bannerText="Setting up ${loggedInUserFirstname}'s Mac"
helpmessage="If you need assistance, please contact the Global Service Department: \n- **Telephone:** +1 (801) 555-1212 \n- **Email:** support@domain.org \n- **Knowledge Base Article:** KB0057050 \n\n**Computer Information:** \n- **Operating System:** ${macOSproductVersion} (${macOSbuildVersion}) \n- **Serial Number:** ${serialNumber} \n- **Dialog:** ${dialogVersion} \n- **Started:** ${timestamp}"
infobox="Analyzing input …" # Customize at "Update Setup Your Mac's infobox"

# Check if the custom bannerImage is available, and if not, use a alternative image
if curl --output /dev/null --silent --head --fail "$bannerImage"; then
echo "bannerImage is available"
amadotejada marked this conversation as resolved.
Show resolved Hide resolved
else
echo "bannerImage is not available, using alternative image"
amadotejada marked this conversation as resolved.
Show resolved Hide resolved
bannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg"
fi

# Create `overlayicon` from Self Service's custom icon (thanks, @meschwartz!)
xxd -p -s 260 "$(defaults read /Library/Preferences/com.jamfsoftware.jamf self_service_app_path)"/Icon$'\r'/..namedfork/rsrc | xxd -r -p > /var/tmp/overlayicon.icns
overlayicon="/var/tmp/overlayicon.icns"
Expand Down