From 6661b875309e5889398bb5d7d4018c6fdd6d3e29 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 27 Apr 2017 09:03:55 +0200 Subject: [PATCH] Add bash and find from findutils in order to avoid surprises from busybox --- Dockerfile | 2 +- dnscrypt-wrapper.sh | 6 +++--- entrypoint.sh | 2 +- key-rotation.sh | 4 ++-- unbound-check.sh | 2 +- unbound.sh | 2 +- watchdog.sh | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index b647033..928947f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER Frank Denis ENV SERIAL 1 ENV BUILD_DEPS make gcc musl-dev git ldns-dev libevent-dev expat-dev shadow autoconf file libexecinfo-dev -ENV RUNTIME_DEPS libressl ldns ldns-tools libevent expat libtool libexecinfo coreutils drill +ENV RUNTIME_DEPS libressl ldns ldns-tools libevent expat libtool libexecinfo coreutils drill findutils bash RUN set -x && \ apk --update upgrade && apk add $RUNTIME_DEPS $BUILD_DEPS diff --git a/dnscrypt-wrapper.sh b/dnscrypt-wrapper.sh index 98ca1f2..c32e178 100755 --- a/dnscrypt-wrapper.sh +++ b/dnscrypt-wrapper.sh @@ -1,17 +1,17 @@ -#! /bin/sh +#! /usr/bin/env bash KEYS_DIR="/opt/dnscrypt-wrapper/etc/keys" STKEYS_DIR="${KEYS_DIR}/short-term" prune() { - find "$STKEYS_DIR" -type f -cmin +1440 -exec rm -f {} \; + /usr/bin/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 -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then + if [ $(/usr/bin/find "$STKEYS_DIR" -type f -cmin -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then echo true else echo false diff --git a/entrypoint.sh b/entrypoint.sh index e02621e..3f969b1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash set -e diff --git a/key-rotation.sh b/key-rotation.sh index 4624ff3..5f67c66 100755 --- a/key-rotation.sh +++ b/key-rotation.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash sleep 1800 @@ -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 -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then + if [ $(/usr/bin/find "$STKEYS_DIR" -type f -cmin -720 -print -quit | wc -l | sed 's/[^0-9]//g') -le 0 ]; then echo true else echo false diff --git a/unbound-check.sh b/unbound-check.sh index ee25294..2273dae 100755 --- a/unbound-check.sh +++ b/unbound-check.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash drill -DQ -p 553 NS . @127.0.0.1 && \ drill -tDQ -p 553 NS . @127.0.0.1 diff --git a/unbound.sh b/unbound.sh index 12d82cd..6cea2e7 100755 --- a/unbound.sh +++ b/unbound.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash KEYS_DIR="/opt/dnscrypt-wrapper/etc/keys" ZONES_DIR="/opt/unbound/etc/unbound/zones" diff --git a/watchdog.sh b/watchdog.sh index 6840445..1d3ed3b 100755 --- a/watchdog.sh +++ b/watchdog.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash sleep 300