pcp-atopsar: fix swptotal and swpfree reporting units
[pcp.git] / build / sun / preremove
blob221ce4c643326b65486f421ee59fe81d4666d967
1 #!/bin/sh
3 # Stop PCP related services before removing the package
6 export PATH=/usr/sbin:$PATH
8 svcs -H svc:/application/pcp/\* \
9 | while read state ts svc; do
10 if [ "$state" = "online" ] ; then
11 svcadm -v disable -s $svc
13 svccfg delete -f $svc
14 done
16 if [ -f /etc/pcp.conf ]
17 then
18 # for all the configuration files we know about, the goal is it
19 # have files with a .pre suffix unless we're certain they have
20 # not been locally altered
22 . /etc/pcp.conf
23 for conf in \
24 $PCP_PMCDCONF_PATH $PCP_PMCDOPTIONS_PATH $PCP_PMCDRCLOCAL_PATH \
25 $PCP_PMIECONTROL_PATH $PCP_PMLOGGERCONTROL_PATH \
26 $PCP_PMPROXYOPTIONS_PATH $PCP_PMWEBDOPTIONS_PATH
28 if [ -f $conf.orig -a -f $conf ]
29 then
30 if cmp -s $conf.orig $conf
31 then
32 # file not changed since installation
33 rm $conf.orig
34 else
35 cp $conf $conf.pre
36 rm $conf.orig
38 elif [ -f $conf ]
39 then
40 cp $conf $conf.pre
42 done