Skip to content

Commit

Permalink
Merge pull request #39 from barracuda-cloudgen-access/fix-extra-variable
Browse files Browse the repository at this point in the history
Add support for bash < 4.4
  • Loading branch information
GMartinez-Sisti committed Jan 31, 2022
2 parents 8fe5071 + d52a4d0 commit c09c9d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cga-connector/scripts/install-cga-connector-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ UNIT_OVERRIDE=("[Service]" "Environment='FYDE_LOGLEVEL=${LOGLEVEL:-"info"}'")
if ! [[ "${UNATTENDED_INSTALL:-}" == "true" ]]; then
UNIT_OVERRIDE+=("Environment='FYDE_ENROLLMENT_TOKEN=${CONNECTOR_TOKEN}'")

if ! [[ "${EXTRA[*]}" =~ AUTH_TOKEN ]] && ! [[ "${EXTRA[*]}" =~ LDAP_ ]]; then
# Support bash<4.4
# shellcheck disable=SC2199
if ! [[ "${EXTRA[@]+"${EXTRA[@]}"}" =~ AUTH_TOKEN ]] && ! [[ "${EXTRA[@]+"${EXTRA[@]}"}" =~ LDAP_ ]]; then
TMPFILE="$(mktemp --tmpdir fyde-connector.XXXXXXX)"
trap 'clear_tmp ${TMPFILE}' EXIT

Expand Down Expand Up @@ -230,7 +232,7 @@ if ! [[ "${UNATTENDED_INSTALL:-}" == "true" ]]; then
exit 2
fi

elif [[ "${EXTRA[*]}" =~ OKTA_AUTH_TOKEN ]] && ! [[ "${EXTRA[*]}" =~ OKTA_DOMAINNAME ]]; then
elif [[ "${EXTRA[@]+"${EXTRA[@]}"}" =~ OKTA_AUTH_TOKEN ]] && ! [[ "${EXTRA[@]+"${EXTRA[@]}"}" =~ OKTA_DOMAINNAME ]]; then
log_entry "ERROR" "okta-auth-token and okta-domainname variables are both mandatory"
exit 2
fi
Expand Down

0 comments on commit c09c9d4

Please sign in to comment.