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.
33 lines
916 B
33 lines
916 B
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
exec 3>&1 # make stdout available as fd 3 for the result
|
|
exec 1>&2 # redirect all output to stderr for logging
|
|
|
|
source $(dirname $0)/common.sh
|
|
|
|
payload=$(mktemp $TMPDIR/concoure-curl-resource-request.XXXXXX)
|
|
|
|
cat > $payload <&0
|
|
|
|
url=$(jq -r '.source.url // ""' < $payload)
|
|
# username=$(jq -r '.source.username // ""' < $payload)
|
|
# password=$(jq -r '.source.password // ""' < $payload)
|
|
skip_ssl_verification=$(jq -r '.source.skip_ssl_verification // ""' < $payload)
|
|
|
|
if [ -z "$url" ]; then
|
|
echo "invalid payload (missing url)"
|
|
exit 1
|
|
fi
|
|
|
|
args_security=
|
|
|
|
# [ -n "$username" ] && args_security="-u $username";
|
|
# [ -n "$password" ] && args_security="$args_security:$password";
|
|
trueValue="true"
|
|
[ -n "$skip_ssl_verification" ] && [ "${skip_ssl_verification,,}" = "${trueValue,,}" ] && args_security="$args_security -k";
|
|
|
|
final_url=$(echo "$args_security" " $url")
|
|
|
|
check_version "$final_url" >&3
|