Skip to content

Instantly share code, notes, and snippets.

@rcapraro
Forked from steve-jansen/README.md
Last active April 1, 2022 13:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rcapraro/a9ebd4db4d1bfe45b02f89aabd6595a3 to your computer and use it in GitHub Desktop.
Save rcapraro/a9ebd4db4d1bfe45b02f89aabd6595a3 to your computer and use it in GitHub Desktop.
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/rcapraro/a9ebd4db4d1bfe45b02f89aabd6595a3/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep

/etc/sudoers

If your user account is not a member of the admin group (i.e., not an OS X Administrator), you need to add the following line to /etc/sudoers using sudo visudo tool:

myusername ALL= NOPASSWD: /usr/local/bin/sep

Example

me:~$ sep stop
/usr/local/bin/sep: relaunching as sudo /usr/local/bin/sep
/usr/local/bin/sep: unloading Symantec Endpoint Protection daemon
/usr/local/bin/sep: unloading Symantec Endpoint Protection shared settings daemon
/usr/local/bin/sep: closing Symantec Endpoint Protection UI widget
me:~$ sudo /usr/local/bin/sep start
/usr/local/bin/sep: relaunching as sudo /usr/local/bin/sep
/usr/local/bin/sep: loading Symantec Endpoint Protection daemon
/usr/local/bin/sep: unloading Symantec Endpoint Protection shared settings daemon
/usr/local/bin/sep: launching Symantec Endpoint Protection UI widget
#!/bin/bash
# relaunch with sudo if we aren't root
if [[ $EUID -ne 0 ]]; then
echo "$0: relaunching as sudo $0 $1 $USER"
sudo "$0" $1 $USER
exit $?
fi
real_user=$USER
if [ -n "$2" ]; then
real_user=$2
fi
stop() {
echo $0: unloading Symantec Endpoint Protection daemon
launchctl unload /Library/LaunchDaemons/com.symantec.symdaemon.NFM.plist
echo $0: unloading Symantec Endpoint Protection Shared settings daemon
launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.NFM.plist
echo $0: unloading Symantec Endpoint Protection Uninstaller tool helper
launchctl unload /Library/LaunchDaemons/com.symantec.UninstallerToolHelper.NFM.plist
echo $0: unloading Symantec Protection LiveUpdate daemon
launchctl unload /Library/LaunchDaemons/com.symantec.liveupdate.daemon.NFM.plist
echo $0: unloading Symantec Protection SymLUHelper daemon
launchctl unload /Library/LaunchDaemons/com.symantec.SymLUHelper.NFM.plist
echo $0: unloading Symantec Protection Error reporting daemon
launchctl unload /Library/LaunchDaemons/com.symantec.errorreporter-periodic.NFM.plist
echo $0: closing Symantec Endpoint Protection UI widget as $real_user
sudo -u $real_user launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.NFM.plist
}
start() {
echo $0: loading Symantec Endpoint Protection daemon
launchctl load /Library/LaunchDaemons/com.symantec.symdaemon.NFM.plist
echo $0: loading Symantec Endpoint Protection shared settings daemon
launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.NFM.plist
echo $0: loading Symantec Endpoint Protection Uninstaller tool helper
launchctl load /Library/LaunchDaemons/com.symantec.UninstallerToolHelper.NFM.plist
echo $0: loading Symantec Protection LiveUpdate daemon
launchctl load /Library/LaunchDaemons/com.symantec.liveupdate.daemon.NFM.plist
echo $0: loading Symantec Protection SymLUHelper daemon
launchctl load /Library/LaunchDaemons/com.symantec.SymLUHelper.NFM.plist
echo $0: loading Symantec Protection Error reporting daemon
launchctl load /Library/LaunchDaemons/com.symantec.errorreporter-periodic.NFM.plist
echo $0: launching Symantec Endpoint Protection UI widget as $real_user
sudo -u $real_user launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.NFM.plist
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac
@rcapraro
Copy link
Author

Add compatibility with OSX Sierra and the latest version of Symantec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment