blob: 9eada9da8162b7fb779fed8724cb9337f88cef33 (
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
|
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
# Keep same perms on pcp.new:
if [ -e etc/rc.d/pcp ]; then
cp -a etc/rc.d/pcp etc/rc.d/pcp.new.incoming
cat etc/rc.d/pcp.new > etc/rc.d/pcp.new.incoming
mv etc/rc.d/pcp.new.incoming etc/rc.d/pcp.new
fi
# Keep same perms on pmie.new:
if [ -e etc/rc.d/pmie ]; then
cp -a etc/rc.d/pmie etc/rc.d/pmie.new.incoming
cat etc/rc.d/pmie.new > etc/rc.d/pmie.new.incoming
mv etc/rc.d/pmie.new.incoming etc/rc.d/pmie.new
fi
# Keep same perms on pmproxy.new:
if [ -e etc/rc.d/pmproxy ]; then
cp -a etc/rc.d/pmproxy etc/rc.d/rc.pmproxy.new.incoming
cat etc/rc.d/pmproxy.new > etc/rc.d/pmproxy.new.incoming
mv etc/rc.d/pmproxy.new.incoming etc/rc.d/pmproxy.new
fi
config etc/rc.d/pcp.new
config etc/rc.d/pmie.new
config etc/rc.d/pmproxy.new
config etc/pcp.conf.new
|