Author Topic: Verify Login Credentials  (Read 1591 times)

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 572
    • View Profile
Verify Login Credentials
« 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
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2228
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Verify Login Credentials
« Reply #1 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.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 572
    • View Profile
Re: Verify Login Credentials
« Reply #2 on: October 13, 2020, 09:52:53 AM »
bash, but ill try that. If thats the fix, shame on me.
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2228
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Verify Login Credentials
« Reply #3 on: October 14, 2020, 10:14:51 AM »
Heh.  I've done worse!  :D

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR