-3

When I trying to install a software license server which is a shell script, I have an error and really don't know the way out. I cannot find any error in the script. Hope anyone can give me some helpenter image description here.

#!/bin/ksh
#----------------------------------------------------------------------------
#                                            COPYRIGHT DASSAULT SYSTEMES 2009
#----------------------------------------------------------------------------
# CREATED : 2009/07/06
#----------------------------------------------------------------------------

# Set variables
OSDS=aix_a64
export OSDS

VERSION=`uname -v`
RELEASE=`uname -r`
echo AIX $VERSION.$RELEASE
RC=0

if [[ $VERSION -lt 7 ]] ; then

  #----------------------------
   # Must be in AIX V7.1.2 or higher
   #----------------------------
   echo AIX 7.1 TL2 is the minimum required level >&2
   RC=1
else
  #-------------------------------------------------------------
  # 7.1 TL2 (libc 7.1.2.0) is the minimum required level of AIX
  #-------------------------------------------------------------
  A=`lslpp -Lqc bos.rte.libc |\
    awk -F: '{ print "bos.rte.libc",$3
               split($3,a,"[.]")
               if      (a[1]<7 )                                  exit 1
               else if (a[1]==7 && a[2]<1)                        exit 1
               else if (a[1]==7 && a[2]==1 && a[3] < 2)           exit 1 }' `
  if [[ $? -ne 0 ]] ; then
    echo  AIX 7.1 TL2 is the minimum required level >&2
    RC=1
  fi
fi

if [[ $RC = 0 ]] ; then
  echo Check Prerequisites for AIX OK
else
  echo >&2
  echo ERROR : Check Prerequisites for AIX KO >&2
  echo >&2
  exit $RC
fi


CURPWD=`pwd` || exit 1
[[ $0 = /* ]] && STARTDIR=$0 || STARTDIR=`echo $CURPWD/$0 | sed 's%/\./%/%g'`
START=${STARTDIR##*/}
STARTDIR=${STARTDIR%/*}
export STARTDIR
echo $STARTDIR

for i in $*
do
   if [[ $i = -h ]] 
    then 
      HELP=TRUE
  fi
done

if [[ $HELP = TRUE ]]
then
    # Help
    ${STARTDIR}/DSYLicServINSTB -h

else
  # Check root, and perform su if necessary
  #----------------------------------------
  if [[ `PATH=$PATH:/usr/ucb whoami` = root ]] ; then
    :
  else
     pbsu=$(eval echo \$$#)
     if [[ $pbsu = pbsu ]] ; then
      echo "Problem when trying to become super-user (root)"
      echo "Please try to become super-user by running following commands:"
      echo "       login root"
      echo "       cd /"
      echo "       $STARTDIR/$START $*"
      echo
      exit 1
     fi
     echo "Log on as super-user (root) before installing"
     echo
     su - root -c "$STARTDIR/$START $* pbsu"
     exit $?
  fi

  #Installation
  [[ -z $DISPLAY ]] && export DISPLAY=`uname -n`:0
  ${STARTDIR}/DSYLicServINSTB $*

fi
  • 2
    Why are you running an AIX shell script on Ubuntu? – thrig Feb 13 '17 at 22:26
  • You're not running the script. You're trying to execute the name of the script as a command. 'script' doesn't run the script; ./script does. But @thrig's question is still pertinent. – DopeGhoti Feb 13 '17 at 22:37
  • @DopeGhoti: Check again. '/path/to/script' is a perfectly valid way of running a script, and it’s clear from the screenshot in the question that the OP is, in fact, running the script. – Scott Aug 27 '17 at 6:26
3

This is a shell script that installs a license server (it is not a license server by itself), specifically written for AIX (as stated in the script itself).

The uname -v command on Ubuntu outputs a text string such as (on my Ubuntu VM):

#39-Ubuntu SMP Thu Jan 26 02:27:07 UTC 2017

On AIX, it obviously outputs a number that can be used in the arithmetic comparison on line 17:

VERSION=`uname -v`
# ...
if [[ $VERSION -lt 7 ]] ; then

You will not be able to run this script on Ubuntu, even if you modified it.

If I were you, I'd be looking for the Linux installation instructions for the license server. If it's Abaqus FLEXnet, then I think RedHat/SuSE is supported. Also do a Google search for "Abaqus FLEXnet Ubuntu" and see if that turns up anything useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.