From 38db967d63574468e07864317a2700f6271eca05 Mon Sep 17 00:00:00 2001 From: Steven King Date: Mon, 2 Dec 2013 10:55:47 +0100 Subject: network/dkimproxy: Added (SMTP-proxy). Signed-off-by: Matteo Bernardini --- network/dkimproxy/doinst.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 network/dkimproxy/doinst.sh (limited to 'network/dkimproxy/doinst.sh') 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 -- cgit v1.2.3