OnDemand User Group

Support Forums => MP Server => Topic started by: jsquizz on October 12, 2020, 12:47:01 PM

Title: Verify Login Credentials
Post by: jsquizz on October 12, 2020, 12:47:01 PM
I have a small script that is running an extract process,

Code: [Select]
$ARSDOC get $MyParams
returnCode=$?
if [ $returnCode -ne 0 ]; then
echo "it didnt work!"
else
echo "it worked!"

A colleague was not in the stash file, and it returned "It worked!" instead of  "It didnt work"

Is there a way that I can verify that a login works, I can add it as a function in my script. Other than using ODWEK.

Thanks in advance
Title: Re: Verify Login Credentials
Post by: Justin Derrick on October 13, 2020, 04:59:28 AM
I suspect you need double braces [[ ]] around comparisons with the -ne operator.  But I'm not sure which shell you're writing in, and they're all a little different and picky about that stuff.

-JD.
Title: Re: Verify Login Credentials
Post by: jsquizz on October 13, 2020, 09:52:53 AM
bash, but ill try that. If thats the fix, shame on me.
Title: Re: Verify Login Credentials
Post by: Justin Derrick on October 14, 2020, 10:14:51 AM
Heh.  I've done worse!  :D

-JD.