diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 588ebe6..58da522 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -8,6 +8,7 @@ bug reports and code to this ntp docker project: - Gontier-Julien => https://github.com/Gontier-Julien - Guru Govindan => https://github.com/ggovindan - Kim Oliver Drechsel => https://github.com/kimdre + - Mingye Wang => https://github.com/Artoria2e5 - Nicolas Carrier => https://github.com/ncarrier - Nicolas Innocenti => https://github.com/nicoinn - Richard Coleman => https://github.com/microbug diff --git a/assets/startup.sh b/assets/startup.sh index 04e33e5..e3b7135 100755 --- a/assets/startup.sh +++ b/assets/startup.sh @@ -38,7 +38,7 @@ if [ -z "${LOG_LEVEL}" ]; then LOG_LEVEL=0 else # confirm log level is between 0-3, since these are the only log levels supported - if [ "${LOG_LEVEL}" -gt 3 ]; then + if expr "${LOG_LEVEL}" : [^0123] > /dev/null; then # level outside of supported range, let's set to default (0) LOG_LEVEL=0 fi @@ -52,15 +52,15 @@ for N in $NTP_SERVERS; do # check if ntp server has a 127.0.0.0/8 address (RFC3330) indicating it's # the local system clock if [[ "${N_CLEANED}" == "127\."* ]]; then - echo "server "${N_CLEANED} >> ${CHRONY_CONF_FILE} + echo "server ${N_CLEANED}" >> ${CHRONY_CONF_FILE} echo "local stratum 10" >> ${CHRONY_CONF_FILE} # found external time servers else if [[ "${ENABLE_NTS:-false}" = true ]]; then - echo "server "${N_CLEANED}" iburst nts" >> ${CHRONY_CONF_FILE} + echo "server ${N_CLEANED} iburst nts" >> ${CHRONY_CONF_FILE} else - echo "server "${N_CLEANED}" iburst" >> ${CHRONY_CONF_FILE} + echo "server ${N_CLEANED} iburst" >> ${CHRONY_CONF_FILE} fi fi done