setup-certbot: Fix shellcheck warnings.

In scripts/setup/setup-certbot line 64:
if [ -z "$DOMAIN" -o -z "$EMAIL" ]; then
                  ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In scripts/setup/setup-certbot line 73:
        method_args=(--webroot --webroot-path=/var/lib/zulip/certbot-webroot/)
                               ^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.

In scripts/setup/setup-certbot line 112:
if [ -z "$deploy_hook" ]; then
         ^-- SC2128: Expanding an array without an index only gives the first element.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2018-08-03 00:14:48 +00:00
committed by Tim Abbott
parent e495eaa339
commit 5a5497c6a1

View File

@@ -61,7 +61,7 @@ if [ -n "$show_help" ]; then
usage
fi
if [ -z "$DOMAIN" -o -z "$EMAIL" ]; then
if [ -z "$DOMAIN" ] || [ -z "$EMAIL" ]; then
usage
fi
@@ -70,7 +70,7 @@ case "$method" in
method_args=(--standalone)
;;
webroot)
method_args=(--webroot --webroot-path=/var/lib/zulip/certbot-webroot/)
method_args=(--webroot '--webroot-path=/var/lib/zulip/certbot-webroot/')
;;
*)
usage
@@ -109,7 +109,7 @@ symlink_with_backup() {
ln -nsf "$1" "$2"
}
if [ -z "$deploy_hook" ]; then
if [ ${#deploy_hook} -eq 0 ]; then
# If no deploy hook was specified, assume we're deploying to the default
# location Zulip wants.
CERT_DIR=/etc/letsencrypt/live/"$DOMAIN"