summaryrefslogtreecommitdiffstats
path: root/network/haproxy/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'network/haproxy/doinst.sh')
-rw-r--r--network/haproxy/doinst.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/network/haproxy/doinst.sh b/network/haproxy/doinst.sh
index ead1b65ea4..a69f086258 100644
--- a/network/haproxy/doinst.sh
+++ b/network/haproxy/doinst.sh
@@ -11,11 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.haproxy.new:
-if [ -e etc/rc.d/rc.haproxy ]; then
- cp -a etc/rc.d/rc.haproxy etc/rc.d/rc.haproxy.new.incoming
- cat etc/rc.d/rc.haproxy.new > etc/rc.d/rc.haproxy.new.incoming
- mv etc/rc.d/rc.haproxy.new.incoming etc/rc.d/rc.haproxy.new
-fi
+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
+}
+
+preserve_perms etc/rc.d/rc.haproxy.new
+config etc/haproxy/haproxy.cfg.new
+
-config etc/rc.d/rc.haproxy.new