From f81fc91bfddaf8e41f2a0b58d4b858a100cf5250 Mon Sep 17 00:00:00 2001 From: "Ahmed R. Awadallah" Date: Mon, 9 Sep 2019 11:15:10 -0400 Subject: [PATCH] Fix build for SC2236 (#496) * attempt to fix build correcting error message from travis ci In ./github-dev/cleanup-pr-branch line 5: if [[ ! -z "$TOKEN" ]]; then ^-- SC2236: Use -n instead of ! -z. * Update cleanup-pr-branch * Update release-email-notification corrected SC2236 * Update upload-assets correct SC2236 * Update sendemail Fix SC2236 * Update entrypoint.sh Fix SC2236 * Update run Fix SC2236 --- github-dev/cleanup-pr-branch | 2 +- github-dev/release-email-notification | 2 +- github-dev/upload-assets | 2 +- mailgun/sendemail | 2 +- mutt/entrypoint.sh | 2 +- postfix/service/postfix/run | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/github-dev/cleanup-pr-branch b/github-dev/cleanup-pr-branch index 3af2446..4a28a96 100755 --- a/github-dev/cleanup-pr-branch +++ b/github-dev/cleanup-pr-branch @@ -2,7 +2,7 @@ set -e set -o pipefail -if [[ ! -z "$TOKEN" ]]; then +if [[ -n "$TOKEN" ]]; then GITHUB_TOKEN=$TOKEN fi diff --git a/github-dev/release-email-notification b/github-dev/release-email-notification index c749ecb..c39e55a 100755 --- a/github-dev/release-email-notification +++ b/github-dev/release-email-notification @@ -8,7 +8,7 @@ if [[ -z "$MAILGUN_API_KEY" ]]; then exit 1 fi -if [[ ! -z "$MAILGUN_DOMAIN" ]]; then +if [[ -n "$MAILGUN_DOMAIN" ]]; then MAILGUN_DOMAIN_NAME=$MAILGUN_DOMAIN fi diff --git a/github-dev/upload-assets b/github-dev/upload-assets index b7936c9..854bf54 100755 --- a/github-dev/upload-assets +++ b/github-dev/upload-assets @@ -1,6 +1,6 @@ #!/bin/bash -if [[ ! -z "$TOKEN" ]]; then +if [[ -n "$TOKEN" ]]; then GITHUB_TOKEN=$TOKEN fi diff --git a/mailgun/sendemail b/mailgun/sendemail index ce1a28b..a1e2ba8 100755 --- a/mailgun/sendemail +++ b/mailgun/sendemail @@ -8,7 +8,7 @@ if [[ -z "$MAILGUN_API_KEY" ]]; then exit 1 fi -if [[ ! -z "$MAILGUN_DOMAIN" ]]; then +if [[ -n "$MAILGUN_DOMAIN" ]]; then MAILGUN_DOMAIN_NAME=$MAILGUN_DOMAIN fi diff --git a/mutt/entrypoint.sh b/mutt/entrypoint.sh index 86ca55e..90a72ee 100755 --- a/mutt/entrypoint.sh +++ b/mutt/entrypoint.sh @@ -47,7 +47,7 @@ if [ -d "$HOME/.gnupg" ]; then if [ -f "/usr/share/doc/mutt/examples/gpg.rc" ]; then echo 'source /usr/share/doc/mutt/examples/gpg.rc' fi - if [ ! -z "$GPG_ID" ]; then + if [ -n "$GPG_ID" ]; then echo "set pgp_sign_as = $GPG_ID" fi echo 'set crypt_replysign=yes' diff --git a/postfix/service/postfix/run b/postfix/service/postfix/run index 97c0e92..6a73ecf 100755 --- a/postfix/service/postfix/run +++ b/postfix/service/postfix/run @@ -14,7 +14,7 @@ EOF # shellcheck disable=SC1091 [ -f /etc/service/postfix/run.config ] && source /etc/service/postfix/run.config -if [[ ! -z "$MAILNAME" ]]; then +if [[ -n "$MAILNAME" ]]; then echo "$MAILNAME" > /etc/mailname postconf -e myorigin="/etc/mailname" @@ -25,15 +25,15 @@ if [[ ! -z "$MAILNAME" ]]; then EOF fi -if [[ ! -z "$MY_NETWORKS" ]]; then +if [[ -n "$MY_NETWORKS" ]]; then postconf -e mynetworks="$MY_NETWORKS" fi -if [[ ! -z "$MY_DESTINATION" ]]; then +if [[ -n "$MY_DESTINATION" ]]; then postconf -e mydestination="$MY_DESTINATION" fi -if [[ ! -z "$ROOT_ALIAS" ]]; then +if [[ -n "$ROOT_ALIAS" ]]; then if [[ -f /etc/aliases ]]; then sed -i '/^root:/d' /etc/aliases fi @@ -41,7 +41,7 @@ if [[ ! -z "$ROOT_ALIAS" ]]; then newaliases fi -if [[ ! -z "$RELAY" ]]; then +if [[ -n "$RELAY" ]]; then # setup the relay cat >> /etc/postfix/main.cf <<- EOF relayhost = $RELAY @@ -52,7 +52,7 @@ if [[ ! -z "$RELAY" ]]; then EOF fi -if [[ ! -z "$TLS" ]]; then +if [[ -n "$TLS" ]]; then # setup tls cat >> /etc/postfix/main.cf <<- EOF smtp_use_tls = yes @@ -60,7 +60,7 @@ if [[ ! -z "$TLS" ]]; then EOF fi -if [[ ! -z "$SASL_AUTH" ]]; then +if [[ -n "$SASL_AUTH" ]]; then cat >> /etc/postfix/main.cf <<- EOF smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd