From 1bbffca294904b2db7942a22b4b5c6fe6e7313fc Mon Sep 17 00:00:00 2001 From: T3slider Date: Sun, 5 Oct 2014 23:38:01 +0700 Subject: network/dnscrypt-proxy: Updated for version 1.4.1. Signed-off-by: Willy Sudiarto Raharjo --- network/dnscrypt-proxy/doinst.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 network/dnscrypt-proxy/doinst.sh (limited to 'network/dnscrypt-proxy/doinst.sh') diff --git a/network/dnscrypt-proxy/doinst.sh b/network/dnscrypt-proxy/doinst.sh new file mode 100644 index 0000000000..11fd7612c2 --- /dev/null +++ b/network/dnscrypt-proxy/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 +} + +preserve_perms etc/rc.d/rc.dnscrypt-proxy.new +config etc/default/dnscrypt-proxy.new +config etc/logrotate.d/dnscrypt-proxy.new -- cgit v1.2.3