Remove content of pkg content dir accidentally imported
[OSXPackageBuilder.git] / pkg content skeleton / DEBIAN / postinstall
1 #!/bin/sh
2
3 # File        :  postinstall
4 #
5 # Purpose     :  execute all tasks necessary following installation of 
6 #                Privoxy's files
7 #
8 # Copyright   :  Written by and Copyright (C) 2001-2013 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 iOSPackageBuilder
32 #                module.
33 #
34
35 #  This postinstall script:
36 #
37 #  1. Creates the logfile if not found and sets its ownership and persmissions
38 #  2. Starts Privoxy
39
40 # preinstall created this file; continue to append to it in this script
41 logfile='/var/privoxy_installation.log'
42
43 # 1. Create Privoxy's logfile if not found and set its ownership and persmissions
44 #
45 if [ ! -d /var/log/privoxy ]; then
46         echo 'Creating Privoxy logfile directory' >> ${logfile}
47         /bin/mkdir -m 0755 /var/log/privoxy >> ${logfile} 2>&1
48 fi
49 echo 'Creating Privoxy logfile and setting owner and permissions' >> ${logfile}
50 /bin/touch /var/log/privoxy/logfile.log >> ${logfile} 2>&1
51 /usr/sbin/chown root:wheel /var/log/privoxy/logfile.log >> ${logfile} 2>&1
52 /bin/chmod 0644 /var/log/privoxy/logfile.log >> ${logfile} 2>&1
53
54 # 2. Start Privoxy
55 #
56 echo 'Start Privoxy via the LaunchDaemon' >> ${logfile}
57 /bin/launchctl load /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
58
59 exit 0