summaryrefslogtreecommitdiff
path: root/network/pdns-recursor/doinst.sh
diff options
context:
space:
mode:
authorAndy Bailey <bailey@akamai.com>2010-07-31 21:53:12 -0500
committerErik Hanson <erik@slackbuilds.org>2010-07-31 21:53:12 -0500
commit04a1ac450578f89b7a8f080e58bb1051b31395e7 (patch)
tree7f27869a592771d61df479357813573f90e3c6d8 /network/pdns-recursor/doinst.sh
parent99377380ae5f995b6119059b7dfb349dffc4ab5d (diff)
downloadslackbuilds-04a1ac450578f89b7a8f080e58bb1051b31395e7.tar.gz
network/pdns-recursor: Added (high-performance recursive resolver)
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'network/pdns-recursor/doinst.sh')
-rw-r--r--network/pdns-recursor/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/network/pdns-recursor/doinst.sh b/network/pdns-recursor/doinst.sh
new file mode 100644
index 0000000000..3dedf64460
--- /dev/null
+++ b/network/pdns-recursor/doinst.sh
@@ -0,0 +1,27 @@
+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
+}
+
+config etc/powerdns/recursor.conf.new
+preserve_perms etc/rc.d/rc.pdns-recursor.new
+