summaryrefslogtreecommitdiff
path: root/network/dansguardian/doinst.sh
diff options
context:
space:
mode:
authorDavid Somero <dsomero@hotmail.com>2013-01-26 23:12:58 -0600
committerRobby Workman <rworkman@slackbuilds.org>2013-02-05 22:40:16 -0600
commitf932c75975bb0322da4f58172b079be04a583ae1 (patch)
tree811e6d731f0c87363587ce80151848369b2fe089 /network/dansguardian/doinst.sh
parent9b9e86c712ce631834585dfa0d0853cef5db404a (diff)
downloadslackbuilds-f932c75975bb0322da4f58172b079be04a583ae1.tar.gz
network/dansguardian: Updated for version 2.12.0.3.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/dansguardian/doinst.sh')
-rw-r--r--network/dansguardian/doinst.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/network/dansguardian/doinst.sh b/network/dansguardian/doinst.sh
index 70cb2a098c..9f153fd0d5 100644
--- a/network/dansguardian/doinst.sh
+++ b/network/dansguardian/doinst.sh
@@ -1,17 +1,31 @@
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.dansguardian.new:
-if [ -e etc/rc.d/rc.dansguardian ]; then
- cp -a etc/rc.d/rc.dansguardian etc/rc.d/rc.dansguardian.new.incoming
- cat etc/rc.d/rc.dansguardian.new > etc/rc.d/rc.dansguardian.new.incoming
- mv etc/rc.d/rc.dansguardian.new.incoming etc/rc.d/rc.dansguardian.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.dansguardian.new
+preserve_perms etc/logrotate.d/dansguardian.new
+
+for FILE in $(find etc/dansguardian -name '*.new'); do
+ preserve_perms $FILE
+done