aboutsummaryrefslogtreecommitdiff
path: root/system/collectd/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/collectd/doinst.sh')
-rw-r--r--system/collectd/doinst.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/system/collectd/doinst.sh b/system/collectd/doinst.sh
index bbbfd14f1af60..6359977249b6e 100644
--- a/system/collectd/doinst.sh
+++ b/system/collectd/doinst.sh
@@ -11,4 +11,16 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
config etc/collectd.conf.new
+preserve_perms etc/rc.d/rc.collectd.new