summaryrefslogtreecommitdiff
path: root/network/znc/doinst.sh
diff options
context:
space:
mode:
authorSean Donner <sean.donner@gmail.com>2010-11-28 02:26:02 -0600
committerHeinz Wiesinger <pprkut@slackbuilds.org>2010-11-29 12:45:58 +0100
commit3638387f02c31f93e79a9aec3158e65b33780247 (patch)
tree4799e5d3522dd5556188383d9dfaa179c2cd624f /network/znc/doinst.sh
parent14a12809754222cfb92fbe196dcc4f08d70f6cdd (diff)
downloadslackbuilds-3638387f02c31f93e79a9aec3158e65b33780247.tar.gz
network/znc: Updated for version 0.096.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/znc/doinst.sh')
-rw-r--r--network/znc/doinst.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/network/znc/doinst.sh b/network/znc/doinst.sh
index d888165f22..a1600c56bc 100644
--- a/network/znc/doinst.sh
+++ b/network/znc/doinst.sh
@@ -1,22 +1,22 @@
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 rc.znc.new:
-if [ -e etc/rc.d/rc.znc ]; then
- cp -a etc/rc.d/rc.znc etc/rc.d/rc.znc.new.incoming
- cat etc/rc.d/rc.znc.new > etc/rc.d/rc.znc.new.incoming
- mv etc/rc.d/rc.znc.new.incoming etc/rc.d/rc.znc.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.znc.new
+preserve_perms etc/rc.d/rc.znc.new