summaryrefslogtreecommitdiff
path: root/python/python-pypolicyd-spf/doinst.sh
diff options
context:
space:
mode:
authordsomero <xgizzmo@slackbuilds.org>2012-09-30 01:13:28 -0400
committerRobby Workman <rworkman@slackbuilds.org>2012-09-30 20:01:06 -0500
commitebc138379a8ff9c8f4d9a3baead9334dd0ead8f3 (patch)
treeea80811f083bb87358dbf89e31e7801e4aee9668 /python/python-pypolicyd-spf/doinst.sh
parent932b788044853a1ad1775e222977ec05d7df7feb (diff)
downloadslackbuilds-ebc138379a8ff9c8f4d9a3baead9334dd0ead8f3.tar.gz
python/python-pypolicyd-spf: Fixed (Don't clobber config files)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'python/python-pypolicyd-spf/doinst.sh')
-rw-r--r--python/python-pypolicyd-spf/doinst.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/python-pypolicyd-spf/doinst.sh b/python/python-pypolicyd-spf/doinst.sh
new file mode 100644
index 0000000000..f5328ded2a
--- /dev/null
+++ b/python/python-pypolicyd-spf/doinst.sh
@@ -0,0 +1,15 @@
+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...
+}
+
+config etc/python-policyd-spf/policyd-spf.conf.new
+