source: ocsinventory-agent/trunk/fuentes/tools/macosx/scripts/uninstaller.sh @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

  • Property svn:executable set to *
File size: 697 bytes
Line 
1#!/bin/bash
2
3OSVER=`uname -r`
4echo "OSVer is $OSVER"
5
6PID=`ps ax -e | grep OCSNG | grep -v grep | grep -v $0 | awk '{print $1}'`
7if [ "$PID" !=  "" ]; then
8        echo "killing process: $PID"
9        sudo kill $PID
10fi
11
12FILES="/Library/Receipts/OCSNG* /etc/ocsinventory-agent/ /var/lib/ocsinventory-agent/ /Applications/OCSNG.app /var/log/ocsng.log"
13
14if [ "$OSVER" == "7.9.0" ]; then
15        FILES="$FILES /Library/StartupItems/OCSInventory"
16else
17        FILES="$FILES /Library/LaunchDaemons/org.ocsng.agent.plist"
18
19        echo 'Stopping and unloading service'
20        launchctl stop org.ocsng.agent
21        launchctl unload /Library/LaunchDaemons/org.ocsng.agent.plist
22fi
23
24for FILE in $FILES; do
25  echo 'removing '.$FILE
26  rm -f -R $FILE
27done
28
Note: See TracBrowser for help on using the repository browser.