Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [2.0.8] - 2022/03/30
Account for users who do not have home directories under /Users

## [2.0.5] - 2021/02/20
Address issue #39. You can define the amount of time to wait for the custom branding, if the icon does not appear in the specified time it defaults to the standard Self Service icon. To-do, add ability to define a custom icon path.

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ This page is for recognition to community members who have assisted in developme
* @aaronpolley
* @arekdreyer
* @erinmc
* @sphen13
11 changes: 6 additions & 5 deletions depNotify.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Version 2.0.7
# Version 2.0.8

#########################################################################################
# License information
Expand Down Expand Up @@ -104,7 +104,8 @@
# This wrapper allows variables that are created later to be used but also allow for
# configuration of where the plist is stored
INFO_PLIST_WRAPPER (){
DEP_NOTIFY_USER_INPUT_PLIST="/Users/$CURRENT_USER/Library/Preferences/menu.nomad.DEPNotifyUserInput.plist"
USER_HOME=$(/usr/bin/dscl . -read /Users/$CURRENT_USER NFSHomeDirectory | cut -d' ' -f2)
DEP_NOTIFY_USER_INPUT_PLIST="$USER_HOME/Library/Preferences/menu.nomad.DEPNotifyUserInput.plist"
}

# Status Text Alignment
Expand Down Expand Up @@ -559,8 +560,8 @@ TRIGGER="event"

# Loop waiting on the branding image to properly show in the users library
SELF_SERVICE_COUNTER=0
CUSTOM_BRANDING_PNG="/Users/$CURRENT_USER/Library/Application Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png"
CUSTOM_BRANDING_PNG="$USER_HOME/Library/Application Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png"

until [ -f "$CUSTOM_BRANDING_PNG" ]; do
echo "$(date "+%a %h %d %H:%M:%S"): Waiting for branding image from Jamf Pro." >> "$DEP_NOTIFY_DEBUG"
sleep 1
Expand Down Expand Up @@ -596,7 +597,7 @@ TRIGGER="event"
INFO_PLIST_WRAPPER

# The plist information below
DEP_NOTIFY_CONFIG_PLIST="/Users/$CURRENT_USER/Library/Preferences/menu.nomad.DEPNotify.plist"
DEP_NOTIFY_CONFIG_PLIST="$USER_HOME/Library/Preferences/menu.nomad.DEPNotify.plist"

# If testing mode is on, this will remove some old configuration files
if [ "$TESTING_MODE" = true ] && [ -f "$DEP_NOTIFY_CONFIG_PLIST" ]; then rm "$DEP_NOTIFY_CONFIG_PLIST"; fi
Expand Down
3 changes: 2 additions & 1 deletion depNotifyReset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

# Removing plists in local user folder
CURRENT_USER=$(/usr/bin/stat -f "%Su" /dev/console)
rm /Users/"$CURRENT_USER"/Library/Preferences/menu.nomad.DEPNotify*
USER_HOME=$(dscl . -read /Users/$CURRENT_USER NFSHomeDirectory | cut -d' ' -f2)
rm "$USER_HOME"/Library/Preferences/menu.nomad.DEPNotify*

# Restarting cfprefsd due to plist changes
killall cfprefsd