Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #129 from nickdgriffin/feature/adop-target-fix
Browse files Browse the repository at this point in the history
Removing checking if target URL contains an IP
  • Loading branch information
anton-kasperovich authored Aug 10, 2016
2 parents 414836d + b001f97 commit 95992ea
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cmd/target
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ set_target() {
set +e
URL_RC=$(curl --max-time 60 -I -s -u ${ADOP_CLI_USER}:${ADOP_CLI_PASSWORD} ${ADOP_CLI_ENDPOINT})
CMD_RC=$?
CMD=$(echo ${ADOP_CLI_ENDPOINT} | egrep 'http://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?$')
CMD_RC=$(($CMD_RC + $?))
set -e

if [ ${CMD_RC} != 0 ] ; then
echo "ERROR: ENDPOINT ${ADOP_CLI_ENDPOINT} is invalid. Check the endpoint url."
echo "ERROR: ENDPOINT ${ADOP_CLI_ENDPOINT} is invalid - return code ${CMD_RC}. Check the endpoint url."
exit 2
elif [ $(echo ${URL_RC} |head -n 1|cut -d$' ' -f2) != 200 ]; then
echo "ERROR: ENDPOINT ${ADOP_CLI_ENDPOINT} is inaccessible using CLI credentials ${ADOP_CLI_USER}:${ADOP_CLI_PASSWORD}. Check the endpoint and credentials"
Expand Down Expand Up @@ -115,4 +113,3 @@ if [ ! -z ${SUBCOMMAND_OPT} ]; then
;;
esac
fi

0 comments on commit 95992ea

Please sign in to comment.