aboutsummaryrefslogtreecommitdiff
path: root/system/c-icap/doinst.sh
diff options
context:
space:
mode:
authorJeremy HOCDE <jeremyhocde@gmail.com>2017-07-20 20:07:11 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-07-22 06:56:17 +0700
commit43be981b640a597a525d85add4deb23f9c164a44 (patch)
tree4afc330a5204f0883b82e6c1512d004d7b893abb /system/c-icap/doinst.sh
parentf52b58e1e972dd41dd8ba82096331b5b0a2a63d8 (diff)
system/c-icap: Added (ICAP server).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/c-icap/doinst.sh')
-rw-r--r--system/c-icap/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/system/c-icap/doinst.sh b/system/c-icap/doinst.sh
new file mode 100644
index 0000000000000..b0a57882fe7d8
--- /dev/null
+++ b/system/c-icap/doinst.sh
@@ -0,0 +1,26 @@
+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...
+}
+
+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.c-icap.new
+config etc/c-icap.conf.new