From 578c25b9f7fe248fff520a5ca3837feb6d1eb141 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 12 Jul 2015 15:43:57 +0200 Subject: [PATCH] Force a rotation if we don't have a key at all --- dnscrypt-wrapper.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dnscrypt-wrapper.sh b/dnscrypt-wrapper.sh index ac574c1..878ef84 100755 --- a/dnscrypt-wrapper.sh +++ b/dnscrypt-wrapper.sh @@ -8,10 +8,14 @@ prune() { } rotation_needed() { - if [ $(find "$STKEYS_DIR" -type f -cmin -43200 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then + if [ ! -f "${STKEYS_DIR}/dnscrypt.cert" ]; then echo true else - echo false + if [ $(find "$STKEYS_DIR" -type f -cmin -43200 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then + echo true + else + echo false + fi fi }