Corrected the module name in the GPL preamble
[OSXPackageBuilder.git] / pkg content skeleton / Applications / Privoxy / stopPrivoxy.sh
1 #!/bin/sh
2
3 # File        :  stopPrivoxy.sh
4 #
5 # Purpose     :  Uses the method appropriate to the host OS X version
6 #                to stop Privoxy
7 #
8 # Copyright   :  Written by and Copyright (C) 2001-2012 the
9 #                Privoxy team. http://www.privoxy.org/
10 #
11 #                This program is free software; you can redistribute it
12 #                and/or modify it under the terms of the GNU General
13 #                Public License as published by the Free Software
14 #                Foundation; either version 2 of the License, or (at
15 #                your option) any later version.
16 #
17 #                This program is distributed in the hope that it will
18 #                be useful, but WITHOUT ANY WARRANTY; without even the
19 #                implied warranty of MERCHANTABILITY or FITNESS FOR A
20 #                PARTICULAR PURPOSE.  See the GNU General Public
21 #                License for more details.
22 #
23 #                The GNU General Public License should be included with
24 #                this file.  If not, you can view it at
25 #                http://www.gnu.org/copyleft/gpl.html
26 #                or write to the Free Software Foundation, Inc.,
27 #                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 #                USA
29 #
30 # Modification : If you modify this file please consider whether your 
31 #                changes ought to be passed back to the OSXPackageBuilder
32 #                module.
33 #
34
35
36 root_UID=0   # Root has $UID 0.
37
38 if [ "$UID" -eq "$root_UID" ]; then
39         # what is the kernel version
40         darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
41         case "${darwin_major_rel_num}" in
42                 # Mac OS X 10.5 or higher
43                 9|1*)
44                         /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist
45                 ;;
46                 # Mac OS X 10.4, 10.3
47                 8|7)
48                         /Library/StartupItems/Privoxy/Privoxy stop
49                 ;;
50                 # default
51                 *)
52                 ;;
53         esac
54 else
55         echo
56   echo This script requires administrator privileges.
57         echo "Please run it from Terminal, using an administrator account, as follows:"
58         echo
59         echo "sudo /Applications/Privoxy/stopPrivoxy.sh"
60         echo
61 fi
62
63 exit 0