You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
946 B

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. #!/bin/bash
  2. set -e
  3. exec 3>&1 # make stdout available as fd 3 for the result
  4. exec 1>&2 # redirect all output to stderr for logging
  5. source $(dirname $0)/common.sh
  6. payload=$(mktemp $TMPDIR/concoure-curl-resource-request.XXXXXX)
  7. cat > $payload <&0
  8. cat $payload
  9. url=$(jq -r '.source.url // ""' < $payload)
  10. # username=$(jq -r '.source.username // ""' < $payload)
  11. # password=$(jq -r '.source.password // ""' < $payload)
  12. skip_ssl_verification=$(jq -r '.source.skip_ssl_verification // ""' < $payload)
  13. if [ -z "$url" ]; then
  14. echo "invalid payload (missing url)"
  15. exit 1
  16. fi
  17. args_security=
  18. # [ -n "$username" ] && args_security="-u $username";
  19. # [ -n "$password" ] && args_security="$args_security:$password";
  20. trueValue="true"
  21. [ -n "$skip_ssl_verification" ] && [ "${skip_ssl_verification,,}" = "${trueValue,,}" ] && args_security="$args_security -k";
  22. final_url=$(echo "$args_security" " $url")
  23. echo $final_url
  24. check_version "$final_url" >&3