diff --git a/Dockerfile b/Dockerfile index 6f77f17..03331a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,7 @@ RUN apk --no-cache --virtual .run-depends add \ curl \ openssl -COPY getsslD /usr/local/bin/getsslD - +COPY getsslD / WORKDIR / COPY ./docker-entrypoint.sh / diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b1f998a..3439e8d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash set -e -WORKING_DIR="/getsslD" +WORKING_DIR="/.getsslD" cd $WORKING_DIR if [ "$1" == "" ] && [ ! -f $WORKING_DIR/getsslD.cfg ]; then - echo "Type to initialize configuration files." + echo "Run with <-c DOMAIN> to initialize configuration files." fi -getsslD --nocheck -w $WORKING_DIR "$@" +/getsslD -w $WORKING_DIR -d "$@" diff --git a/getsslD b/getsslD index 85c84d8..85d3925 100755 --- a/getsslD +++ b/getsslD @@ -454,6 +454,11 @@ error_exit() { # give error message on error exit exit 1 } +error() { + # Write error message to STDERR for log. + echo "$@" >&2 +} + get_auth_dns() { # get the authoritative dns server for a domain (sets primary_ns ) gad_d="$1" # domain name gad_s="$PUBLIC_DNS_SERVER" # start with PUBLIC_DNS_SERVER @@ -923,8 +928,7 @@ urlbase64() { # urlbase64: base64 encoded string with '+' replaced with '-' and } usage() { # echos out the program usage - echo "Usage: $PROGNAME [-h|--help] [-d|--debug] [-c|--create] [-f|--force] [-a|--all] [-q|--quiet]"\ - "[-r|--revoke cert key] DOMAIN" + echo "Usage: $PROGNAME [options] [ARGS]" } write_domain_template() { # write out a template file for a domain. @@ -1096,6 +1100,7 @@ AGREEMENT=$(curl -I "${CA}/terms" 2>/dev/null | awk '$1 ~ "Location:" {print $2} # if nothing in command line, print help and exit. if [[ -z "$DOMAIN" ]] && [[ ${_CHECK_ALL} != "true" ]]; then + error "Domain is required for this option." help_message graceful_exit fi