Created
September 29, 2020 02:26
-
-
Save sdagley/7b53730239c1121eb4e56cc0f65b00b7 to your computer and use it in GitHub Desktop.
Install PrivilegedHelper and LaunchDaemon for the McAfee ENS 10.7.1 version of McAfee Agent Status Monitor.app so users aren't prompted for admin credentials to do the install the first time they slect the app from the McAfee Menulet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install PrivilegedHelper and LaunchDaemon for the McAfee ENS 10.7.1 version of | |
# McAfee Agent Status Monitor.app so users aren't prompted for admin credentials to | |
# do the install the first time they select the app from the McAfee Menulet | |
helperSourcePath="/Library/Application Support/McAfee/MSS/Applications/McAfee Agent Status Monitor.app/Contents/Library/LaunchServices/com.mcafee.agentMonitor.helper" | |
helperDestinationPath="/Library/PrivilegedHelperTools/com.mcafee.agentMonitor.helper" | |
if [ -f "$helperSourcePath" ] && [ ! -f "helperDestinationPath" ]; then | |
if [ ! -d "/Library/PrivilegedHelperTools" ]; then | |
/bin/mkdir -p "/Library/PrivilegedHelperTools" | |
/bin/chmod 755 "/Library/PrivilegedHelperTools" | |
/usr/sbin/chown -R root:wheel "/Library/PrivilegedHelperTools" | |
fi | |
if /bin/cp -f "$helperSourcePath" "/Library/PrivilegedHelperTools"; then | |
/bin/chmod 755 "$helperDestinationPath" | |
# create the LaunchDaemon plist | |
helperPlistPath="/Library/LaunchDaemons/com.mcafee.agentMonitor.helper.plist" | |
/bin/cat > "$helperPlistPath" << EOF | |
<?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.mcafee.agentMonitor.helper</string> | |
<key>MachServices</key> | |
<dict> | |
<key>com.mcafee.agentMonitor.helper</key> | |
<true/> | |
</dict> | |
<key>Program</key> | |
<string>/Library/PrivilegedHelperTools/com.mcafee.agentMonitor.helper</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Library/PrivilegedHelperTools/com.mcafee.agentMonitor.helper</string> | |
</array> | |
</dict> | |
</plist> | |
EOF | |
/bin/chmod 644 "$helperPlistPath" | |
/bin/launchctl bootstrap system "$helperPlistPath" | |
fi | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment