Skip to content

Commit

Permalink
Merge pull request #6 from vmarora/main
Browse files Browse the repository at this point in the history
fix: change log function to work with set -euo pipefail
  • Loading branch information
sentoz authored Oct 20, 2022
2 parents 86e243c + 2e9feb3 commit a0a4d83
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions connector-restart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ log() {
"${lvl^^}" "$(date-fmt)" "$msg"

# Exiting the script when an error or success message appears
[ "${lvl,,}" == error ] && exit 1
[ "${lvl,,}" == success ] && exit 0
if [ "${lvl,,}" == error ]; then
exit 1
fi

if [ "${lvl,,}" == success ]; then
exit 0
fi
}

get_connectors() {
Expand Down Expand Up @@ -181,4 +186,4 @@ else
"Connect to API Kafka Connect $_connect_url failed" \
"with status code $? and message $connectorsjson"
fi
fi
fi

0 comments on commit a0a4d83

Please sign in to comment.