Skip to main content

Hello Team,

After installing Nudge and pushing the configuration profile, the Nudge Agent do not open. 
We have 12.4.0 version of OS Installed.


Please let me know what is that has to be changed/Modified.

 

I've install Nudge_Suite-1.1.8.81421.pkg and configured the profile too.

Upload File
PLIST file containing key value pairs for settings in the specified domain
 

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>PayloadContent</key> <dict> <key>com.github.macadmins.Nudge</key> <dict> <key>Forced</key> <array> <dict> <key>mcx_preference_settings</key> <dict> <key>optionalFeatures</key> <dict> <key>acceptableApplicationBundleIDs</key> <array> <string>us.zoom.xos</string> <string>com.apple.iWork.Keynote</string> <string>com.apple.Keynote</string> <string>com.microsoft.Powerpoint</string> <string>com.cisco.webexmeetingsapp</string> <string>com.webex.meetingmanager</string> <string>Cisco-Systems.Spark</string> </array> <key>aggressiveUserExperience</key> <true/> <key>attemptToFetchMajorUpgrade</key> <true/> <key>enforceMinorUpdates</key> <true/> </dict> <key>osVersionRequirements</key> <array> <dict> <key>aboutUpdateURL</key> <string>https://support.apple.com/en-us/HT212585</string> <key>requiredInstallationDate</key> <string>2022-8-05T17:00:00Z</string> <key>requiredMinimumOSVersion</key> <string>12.5.0</string> <key>targetedOSVersionsRule</key> <string>12</string> </dict> </array> <key>userExperience</key> <dict/> <key>userInterface</key> <dict> <key>iconDarkPath</key> <string>/path/to/image.png</string> <key>iconLightPath</key> <string>/path/to/other-image.png</string> <key>showDeferralCount</key> <true/> <key>singleQuitButton</key> <true/> <key>updateElements</key> <array> <dict> <key>_language</key> <string>en</string> <key>mainContentText</key> <string>Hey there! \\n\\nWe noticed this Mac has available software updates. Keeping macOS up-to-date is an important part in keeping devices and data secure.\\n\\nPlease update this Mac by clicking the Update Device button to install the available updates.</string> <key>mainHeader</key> <string>This Mac requires a security update</string> <key>subHeader</key> <string>A friendly reminder from IT ❤️</string> </dict> </array> </dict> </dict> </dict> </array> </dict> </dict> <key>PayloadDisplayName</key> <string>Custom Settings</string> <key>PayloadIdentifier</key> <string> </string> <key>PayloadOrganization</key> <string> </string> <key>PayloadType</key> <string> </string> <key>PayloadUUID</key> <string> </string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDescription</key> <string></string> <key>PayloadDisplayName</key> <string>Nudge OS Update Settings</string> <key>PayloadEnabled</key> <true/> <key>PayloadIdentifier</key> <string> </string> <key>PayloadOrganization</key> <string> </string> <key>PayloadRemovalDisallowed</key> <true/> <key>PayloadScope</key> <string>System</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string> </string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist>

 

Hi @bwoods ,
The result of your script shows me this error, any idea ?

Running script Create com.github.macadmins.Nudge.plist...
Script exit code: 0
Script result: Nudge launch agent is not present.
/Library/Application Support/JAMF/tmp/Create com.github.macadmins.Nudge.plist: line 20: /Users/myuser/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory
/Users/myuser/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory
Load failed: 2: No such file or directory

Actually, in this instance, this means the LaunchAgents directory does not exist so it can't create the LaunchAgent file. I made an edit to fix this as I think it's an issue with newer MacOS version like Ventura as those directories don't exist for users by default anymore. Here is the script with my edit to make the directory needed before the echo.

 

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name 😕 && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is present"
/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is not present."
fi

mkdir "/Users/$currentUser/Library/LaunchAgents/"

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0 ## Success
exit 1 ## Failure

 

  


Actually, in this instance, this means the LaunchAgents directory does not exist so it can't create the LaunchAgent file. I made an edit to fix this as I think it's an issue with newer MacOS version like Ventura as those directories don't exist for users by default anymore. Here is the script with my edit to make the directory needed before the echo.

 

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name 😕 && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is present"
/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is not present."
fi

mkdir "/Users/$currentUser/Library/LaunchAgents/"

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0 ## Success
exit 1 ## Failure

 

  


Good catch, that folder exists on all of my clients because of Onedrive. May not be the case for everyone else.


Example of 4 hours

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name 😕 && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is present"
/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is not present."
fi

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>14400</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0 ## Success
exit 1 ## Failure

I pushed the launch agent that is part of the nudge suit package on GitHub. Will this script overwrite and/or stop that default agent and use your script instead? 


Actually, in this instance, this means the LaunchAgents directory does not exist so it can't create the LaunchAgent file. I made an edit to fix this as I think it's an issue with newer MacOS version like Ventura as those directories don't exist for users by default anymore. Here is the script with my edit to make the directory needed before the echo.

 

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name 😕 && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is present"
/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
echo "Nudge launch agent is not present."
fi

mkdir "/Users/$currentUser/Library/LaunchAgents/"

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0 ## Success
exit 1 ## Failure

 

  


Thanks for this! Worked great on the majority of devices but I have a few outliers that error out. I get the "/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory" but instead of creating the plist I get "Load Failed: 5: Input/output error" Any ideas?


Thanks for this! Worked great on the majority of devices but I have a few outliers that error out. I get the "/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory" but instead of creating the plist I get "Load Failed: 5: Input/output error" Any ideas?


Probably need to run a pre-script to bootout the LaunchAgent if it's already running.

#!/bin/bash

#Preinstall Script

#Daemon Preinstall
plistPath="/Library/LaunchAgents/com.github.macadmins.Nudge.plist"

#Boot it out if it already exists

if [[ -e $plistPath ]]; then
launchctl bootout system $plistPath
rm -f $plistPath
fi

 


Reply