summaryrefslogtreecommitdiff
path: root/build/mac/installer-resources/preupgrade
blob: 95de66b988ebe0edad0a99aebcf9d2218de14f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# Copyright (c) 2003-2004 Silicon Graphics, Inc.  All Rights Reserved.
# 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
# 

/Library/StartupItems/pcp/pcp stop

if [ -f /etc/pcp.conf ]
then
    # for all the configuration files we know about, the goal is it
    # have files with a .pre suffix unless we're certain they have
    # not been locally altered
    #
    . /etc/pcp.conf
    for conf in \
	$PCP_PMCDCONF_PATH $PCP_PMCDOPTIONS_PATH $PCP_PMCDRCLOCAL_PATH \
	$PCP_PMIECONTROL_PATH $PCP_PMLOGGERCONTROL_PATH \
	$PCP_PMPROXYOPTIONS_PATH $PCP_PMWEBDOPTIONS_PATH
    do
	if [ -f $conf.orig -a -f $conf ]
	then
	    if cmp -s $conf.orig $conf
	    then
		# file not changed since installation
		rm $conf.orig
	    else
		cp $conf $conf.pre
		rm $conf.orig
	    fi
	elif [ -f $conf ]
	then
	    cp $conf $conf.pre
	fi
    done
fi

exit 0