Skip to content

Commit c4c7cce

Browse files
committed
Implement the '-q' and '--quiet' options
1 parent 70da5dd commit c4c7cce

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

rootfs/certificate-manager.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ DEPLOY_DOCKER_LABEL=${DEPLOY_DOCKER_LABEL:-"sh.acme.deploy"}
3636
DEFAULT_CONTAINER_CERTIFICATE_STORE=${DEFAULT_CONTAINER_CERTIFICATE_STORE:-"/certs"}
3737
DEFAULT_CERTIFICATE_DEPLOYMENT=${DEFAULT_CERTIFICATE_DEPLOYMENT:-"crt,key"}
3838

39+
silence_output=false
40+
verbose=false
41+
3942
# Return status codes:
4043
# 0: certificate is valid and up to date
4144
# 1: certificate has expired
@@ -576,7 +579,7 @@ help() {
576579
echo " --version Show the version of the certificate manager"
577580
fi
578581
echo " -h, --help Show this help message"
579-
echo " -q, --quite Disable all output"
582+
echo " -q, --quiet Disable all output"
580583
echo " -v, --verbose Enable verbose output"
581584
echo ""
582585

@@ -625,13 +628,21 @@ while [ $# -gt 0 ]; do
625628
help "$action"
626629
exit 0
627630
;;
631+
-q|--quiet)
632+
silence_output=true
633+
;;
628634
*)
629635
# ignore any other options as they are passed directly to the action to handle
630636
;;
631637
esac
632638
shift
633639
done
634640

641+
# @todo: this should be done in a better way (maybe logfile)
642+
if [ "$silence_output" == true ]; then
643+
exec > /dev/null 2>&1
644+
fi
645+
635646
# set default CA server
636647
acme.sh --set-default-ca --server "$ACME_CA" --uninstall-cronjob >/dev/null 2>&1
637648

0 commit comments

Comments
 (0)