aboutsummaryrefslogtreecommitdiff
path: root/network/cherokee/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'network/cherokee/doinst.sh')
-rw-r--r--network/cherokee/doinst.sh23
1 files changed, 11 insertions, 12 deletions
diff --git a/network/cherokee/doinst.sh b/network/cherokee/doinst.sh
index 095b7f2381ff7..c5bd90e9d972c 100644
--- a/network/cherokee/doinst.sh
+++ b/network/cherokee/doinst.sh
@@ -8,17 +8,16 @@ config() {
fi
}
-if [ -e etc/rc.d/rc.cherokee ]; then
- cp -a etc/rc.d/rc.cherokee etc/rc.d/rc.cherokee.new.incoming
- cat etc/rc.d/rc.cherokee.new > etc/rc.d/rc.cherokee.new.incoming
- mv etc/rc.d/rc.cherokee.new.incoming etc/rc.d/rc.cherokee.new
-fi
-
-if [ -e etc/cherokee/cherokee.conf ]; then
- cp -a etc/cherokee/cherokee.conf etc/cherokee/cherokee.conf.new.incoming
- cat etc/cherokee/cherokee.conf.new > etc/cherokee/cherokee.conf.new.incoming
- mv etc/cherokee/cherokee.conf.new.incoming etc/cherokee/cherokee.conf.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
+}
-config etc/rc.d/rc.cherokee.new
+preserve_perms etc/rc.d/rc.cherokee.new
config etc/cherokee/cherokee.conf.new