Skip to content

Instantly share code, notes, and snippets.

@fabiand93
Forked from steve-jansen/README.md
Created March 23, 2022 19:26
Show Gist options
  • Save fabiand93/6cc7050d6a3621ccf95b4f1c524b8d7b to your computer and use it in GitHub Desktop.
Save fabiand93/6cc7050d6a3621ccf95b4f1c524b8d7b to your computer and use it in GitHub Desktop.

Revisions

  1. @steve-jansen steve-jansen revised this gist May 24, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions sep
    Original file line number Diff line number Diff line change
    @@ -14,24 +14,24 @@ fi

    stop() {
    echo $0: unloading Symantec Endpoint Protection daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.symdaemon.plist
    launchctl unload /Library/LaunchDaemons/com.symantec.symdaemon.*plist

    echo $0: unloading Symantec Endpoint Protection shared settings daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.plist
    launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.*plist

    echo $0: closing Symantec Endpoint Protection UI widget as $real_user
    sudo -u $real_user launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.plist
    sudo -u $real_user launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.*plist
    }

    start() {
    echo $0: loading Symantec Endpoint Protection daemon
    launchctl load /Library/LaunchDaemons/com.symantec.symdaemon.plist
    launchctl load /Library/LaunchDaemons/com.symantec.symdaemon.*plist

    echo $0: loading Symantec Endpoint Protection shared settings daemon
    launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.plist
    launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.*plist

    echo $0: launching Symantec Endpoint Protection UI widget as $real_user
    sudo -u $real_user launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.plist
    sudo -u $real_user launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.*plist
    }

    case "$1" in
  2. @steve-jansen steve-jansen revised this gist Sep 26, 2014. 1 changed file with 11 additions and 7 deletions.
    18 changes: 11 additions & 7 deletions sep
    Original file line number Diff line number Diff line change
    @@ -2,21 +2,25 @@

    # relaunch with sudo if we aren't root
    if [[ $EUID -ne 0 ]]; then
    echo "$0: relaunching as sudo $0"
    sudo "$0" $@
    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.plist

    echo $0: unloading Symantec Endpoint Protection shared settings daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: closing Symantec Endpoint Protection UI widget as $USER
    sudo -u $USER launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.plist
    killall SymUIAgent
    echo $0: closing Symantec Endpoint Protection UI widget as $real_user
    sudo -u $real_user launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.plist
    }

    start() {
    @@ -26,8 +30,8 @@ start() {
    echo $0: loading Symantec Endpoint Protection shared settings daemon
    launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: launching Symantec Endpoint Protection UI widget as $USER
    sudo -u $USER launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.plist
    echo $0: launching Symantec Endpoint Protection UI widget as $real_user
    sudo -u $real_user launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.plist
    }

    case "$1" in
  3. @steve-jansen steve-jansen revised this gist Sep 24, 2014. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions sep
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,8 @@ stop() {
    echo $0: unloading Symantec Endpoint Protection shared settings daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: closing Symantec Endpoint Protection UI widget
    echo $0: closing Symantec Endpoint Protection UI widget as $USER
    sudo -u $USER launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.plist
    killall SymUIAgent
    }

    @@ -25,8 +26,8 @@ start() {
    echo $0: loading Symantec Endpoint Protection shared settings daemon
    launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: launching Symantec Endpoint Protection UI widget
    killall SymUIAgent
    echo $0: launching Symantec Endpoint Protection UI widget as $USER
    sudo -u $USER launchctl load /Library/LaunchAgents/com.symantec.uiagent.application.plist
    }

    case "$1" in
  4. @steve-jansen steve-jansen revised this gist Sep 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ This script enables you stop and start Symantec Endpoint Protection on OS X
    ## Installation

    ```
    sudo curl https://gist.github.com/steve-jansen/dacad2fd9be9ff93917c/raw/sep -o /usr/local/bin/sep
    sudo curl https://gist.github.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
    sudo chmod 755 /usr/local/bin/sep
    sudo chown root:staff /usr/local/bin/sep
    ```
  5. @steve-jansen steve-jansen created this gist Sep 24, 2014.
    34 changes: 34 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    This script enables you stop and start Symantec Endpoint Protection on OS X

    ## Installation

    ```
    sudo curl https://gist.github.com/steve-jansen/dacad2fd9be9ff93917c/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
    ```
    42 changes: 42 additions & 0 deletions sep
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    #!/bin/bash

    # relaunch with sudo if we aren't root
    if [[ $EUID -ne 0 ]]; then
    echo "$0: relaunching as sudo $0"
    sudo "$0" $@
    exit $?
    fi

    stop() {
    echo $0: unloading Symantec Endpoint Protection daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.symdaemon.plist

    echo $0: unloading Symantec Endpoint Protection shared settings daemon
    launchctl unload /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: closing Symantec Endpoint Protection UI widget
    killall SymUIAgent
    }

    start() {
    echo $0: loading Symantec Endpoint Protection daemon
    launchctl load /Library/LaunchDaemons/com.symantec.symdaemon.plist

    echo $0: loading Symantec Endpoint Protection shared settings daemon
    launchctl load /Library/LaunchDaemons/com.symantec.sharedsettings.plist

    echo $0: launching Symantec Endpoint Protection UI widget
    killall SymUIAgent
    }

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    *)
    echo "Usage: $0 [start|stop]"
    ;;
    esac