From bd5df072a9d2dc9cc44b8de5f825697271073210 Mon Sep 17 00:00:00 2001 From: Tyler Perkins <45907232+Clortox@users.noreply.github.com> Date: Fri, 16 Dec 2022 21:26:18 -0500 Subject: [PATCH] Make curl u param more dynamic (#13) --- main.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.sh b/main.sh index 44ff524..c5650c4 100755 --- a/main.sh +++ b/main.sh @@ -16,6 +16,10 @@ Message=${PLUGIN_MESSAGE:-Pipeline finished!} Username=${PLUGIN_USERNAME:-} Password=${PLUGIN_PASSWORD:-} +if [[ ! -z $Username ]] || [[ ! -z $Password ]]; then + UParam="-u $Username:$Password" +fi + if [[ ! -z $Priority ]]; then Priority="-H Priority:$Priority" fi @@ -40,5 +44,5 @@ if [[ ! -z $Icon ]]; then Icon="-H Icon:$Icon" fi -curl $Priority $Title $Tags $Click $Attach $Icon -u $Username:$Password -d "$Message" $URL/$Topic -#curl $Priority $Title $Tags $Click $Attach $Icon -u $Username:$Password -d "$Message" $URL/$Topic +curl $Priority $Title $Tags $Click $Attach $Icon $UParam -d "$Message" $URL/$Topic +#curl $Priority $Title $Tags $Click $Attach $Icon $UParam -d "$Message" $URL/$Topic