1
1
mirror of https://github.com/dnscrypt/dnscrypt-server-docker synced 2024-11-22 19:42:03 +01:00

find -cmin argument is in minutes, not seconds

This commit is contained in:
Frank Denis 2015-08-08 16:09:38 +02:00
parent a7f169b085
commit b2f09ff6d6
2 changed files with 3 additions and 3 deletions

@ -4,14 +4,14 @@ KEYS_DIR="/opt/dnscrypt-wrapper/etc/keys"
STKEYS_DIR="${KEYS_DIR}/short-term"
prune() {
find "$STKEYS_DIR" -type f -cmin +86400 -exec rm -f {} \;
find "$STKEYS_DIR" -type f -cmin +1440 -exec rm -f {} \;
}
rotation_needed() {
if [ ! -f "${STKEYS_DIR}/dnscrypt.cert" ]; then
echo true
else
if [ $(find "$STKEYS_DIR" -type f -cmin -43200 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then
if [ $(find "$STKEYS_DIR" -type f -cmin -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then
echo true
else
echo false

@ -6,7 +6,7 @@ KEYS_DIR="/opt/dnscrypt-wrapper/etc/keys"
STKEYS_DIR="${KEYS_DIR}/short-term"
rotation_needed() {
if [ $(find "$STKEYS_DIR" -type f -cmin -43200 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then
if [ $(find "$STKEYS_DIR" -type f -cmin -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then
echo true
else
echo false