aboutsummaryrefslogtreecommitdiff
path: root/system/supervisor/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/supervisor/doinst.sh')
-rw-r--r--system/supervisor/doinst.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/system/supervisor/doinst.sh b/system/supervisor/doinst.sh
index b0b5ad409c..45a411365c 100644
--- a/system/supervisor/doinst.sh
+++ b/system/supervisor/doinst.sh
@@ -1,13 +1,23 @@
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 redu
-ndant copy
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm $NEW
fi
- # 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/supervisord.conf.new
+preserve_perms etc/rc.d/rc.supervisord.new