nixos/dnscrypt-proxy: indicate update status

Make it easier for the user to tell when the list is updated
and, at their option, see what changed.
This commit is contained in:
Joachim Fasting 2017-03-08 03:09:22 +01:00
parent 5f27abec23
commit 06520c7fb7
No known key found for this signature in database
GPG Key ID: 7544761007FE4E08

View File

@ -266,7 +266,7 @@ in
requires = [ "init-dnscrypt-proxy-statedir.service" ];
after = [ "init-dnscrypt-proxy-statedir.service" ];
path = with pkgs; [ curl dnscrypt-proxy minisign ];
path = with pkgs; [ curl diffutils dnscrypt-proxy minisign ];
script = ''
cd ${stateDirectory}
domain=download.dnscrypt.org
@ -278,7 +278,13 @@ in
mv dnscrypt-resolvers.csv.minisig{.tmp,}
minisign -q -V -p ${upstreamResolverListPubKey} \
-m dnscrypt-resolvers.csv.tmp -x dnscrypt-resolvers.csv.minisig
[[ -f dnscrypt-resolvers.csv ]] && mv dnscrypt-resolvers.csv{,.old}
mv dnscrypt-resolvers.csv{.tmp,}
if cmp dnscrypt-resolvers.csv{,.old} ; then
echo "no change"
else
echo "resolver list updated"
fi
'';
serviceConfig = {