diff options
author | Steven King <kingrst@gmail.com> | 2013-12-02 10:55:47 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-12-06 00:00:08 -0600 |
commit | 38db967d63574468e07864317a2700f6271eca05 (patch) | |
tree | 1a1b041b444fc8841a4810613cecd76488ecd0b6 /network/dkimproxy/doinst.sh | |
parent | 98ae15ded44bf9ccadd24cdbafea18b4f3114133 (diff) | |
download | slackbuilds-38db967d63574468e07864317a2700f6271eca05.tar.gz |
network/dkimproxy: Added (SMTP-proxy).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network/dkimproxy/doinst.sh')
-rw-r--r-- | network/dkimproxy/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/network/dkimproxy/doinst.sh b/network/dkimproxy/doinst.sh new file mode 100644 index 0000000000..9c8c287343 --- /dev/null +++ b/network/dkimproxy/doinst.sh @@ -0,0 +1,25 @@ +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.dkimproxy.new |