home *** CD-ROM | disk | FTP | other *** search
/ ftp.rsa.com / 2014.05.ftp.rsa.com.tar / ftp.rsa.com / pub / agents / PAM-Agent_v7.0.1.29.02_25_11_04_30_33.tar / PAM-Agent_v7.0.0.29.02_25_11_04_30_33 / install_pam.sh next >
Linux/UNIX/POSIX Shell Script  |  2011-02-25  |  21KB  |  673 lines

  1. #!/bin/sh 
  2. #
  3. # Installation script for the RSA Authentication Agent 7.0 for PAM.
  4. #
  5. #
  6. #********************************************************************************
  7. #* COPYRIGHT (C) 2007-2010 by EMC Corporation.
  8. #*    ---ALL RIGHTS RESERVED---
  9. #********************************************************************************
  10. #
  11.  
  12. ############################################################
  13. # Set default values and commands for the shell script.
  14. ############################################################
  15. UNAME=`uname`
  16. UNAMER=`uname -r`
  17. HOSTNAME=`hostname`
  18. USER_NAME=""
  19. GREP=`which grep`
  20. ECHO=`which echo`
  21.  
  22. HERE=`dirname $0` 
  23. THEPWD=`/bin/pwd`
  24.  
  25. if [ "$HERE" = "." ]; then
  26.     HERE="$THEPWD"
  27. else
  28. #if $HERE isn't absolute path add `pwd` to it
  29.  
  30.     cd "$HERE"
  31.     HERE=`/bin/pwd`
  32.     cd "$THEPWD"
  33. fi
  34.  
  35. ########################
  36. ########################
  37. CONFIG_FILE=""
  38. PAM_AGENT="/tmp/toto"
  39. PAM_AGENT_TAR="sd_pam_agent.tar"
  40. PAM_AGENT_MODULE="pam_securid"
  41. #PAM_AGENT_DOC="doc"
  42. PAM_AGENT_README="readme.html"
  43. PAM_AGENT_TAR_GZ="$PAM_AGENT_TAR.gz"
  44. PAM_CONFIG="/etc/sd_pam.conf"
  45. LICENSE="$HERE/license.txt"
  46. MODULE_DIR_PRIMARY="/usr/lib/security"
  47. MODULE_DIR_SECONDARY="/usr/lib/security/64"
  48. ARCH=""
  49. PATH_ROOT=""
  50. echo_no_nl_mode="unknown"
  51.  
  52. ##############################################################################
  53. # Trap 
  54. #    this will trap any escape characters, and allow the program to abort normally 
  55. #    by calling abort_installation
  56. ##############################################################################
  57. trap 'trap "" 1 2 15; abort_installation' 1 2 15
  58.  
  59. ##############################################################################
  60. # echo_no_nl()
  61. #       Echo a string with no carriage return (if possible).  Must set
  62. #       $echo_no_nl to "unknown" before using for the first time.
  63. ##############################################################################
  64. echo_no_nl()
  65. {
  66.   if [ "$echo_no_nl_mode" = "unknown" ] ; then
  67.      echo_test=`echo \\\c`
  68.      if [ "$echo_test" = "\c" ] ; then
  69.         echo_no_nl_mode="-n"
  70.      else
  71.         echo_no_nl_mode="\c"
  72.      fi
  73.   fi
  74.  
  75.   if [ "$echo_no_nl_mode" = "\c" ] ; then
  76.      echo $* \\c
  77.   else
  78.      echo -n $*
  79.   fi
  80. }
  81.  
  82.  
  83. ##############################################################################
  84. # getfilename()
  85. # Gets a filename
  86. #   $1  The string to print to prompt the user
  87. #   $2  The default value if user hits <Enter> (y/n)
  88. #   $3  Type : DIRECTORY, EXISTINGFILE, NEWFILE, NEWDIRECTORY
  89. # The variable $YESORNO is set in accordance to what the user entered.
  90. ##############################################################################
  91. getfilename()
  92. {
  93. #####################################################
  94. # Set up line parameters as $1 and $2 are overwritten
  95. #####################################################
  96.   theprompt=$1
  97.   thedefault=$2
  98.   thetype=$3
  99.  
  100.   theans=""
  101.   until [ -n "$theans" ] ;
  102.   do
  103.     echo ""
  104.     echo_no_nl "$theprompt [$thedefault] "
  105.     read theans
  106.  
  107.     if [ "$theans" = "" ] ; then
  108.       theans=$thedefault
  109.     fi
  110.     case $thetype in
  111.         DIRECTORY) if [ ! -d "$theans" ]; then
  112.                         echo Directory $theans doesn\'t exist
  113.                         theans=""
  114.                    fi;;
  115.         READFILE)  if [ ! -f "$theans" ]; then
  116.                         echo File $theans doesn\'t exist
  117.                         theans=""
  118.                    elif [ ! -r "$theans" ]; then
  119.                         echo File "$theans" isn\'t readable
  120.                         theans=""
  121.                    fi;;
  122.         WRITEFILE)  if [ ! -f "$theans" ]; then
  123.                         echo File $theans doesn\'t exist
  124.                         theans=""
  125.                    elif [ ! -w "$theans" ]; then
  126.                         echo File "$theans" isn\'t writable
  127.                         theans=""
  128.                    fi;;
  129.         EXECFILE)  if [ ! -f "$theans" ]; then
  130.                         echo File $theans doesn\'t exist
  131.                         theans=""
  132.                    elif [ ! -x "$theans" ]; then
  133.                         echo File "$theans" isn\'t writable
  134.                         theans=""
  135.                    fi;;
  136.         NEWFILE)   if [ -f "$theans" ]; then
  137.                         echo File $theans already exist
  138.                         theans=""
  139.                    elif [ ! -d `dirname $theans` ]; then
  140.                         echo Directory `dirname $theans` doesn\'t exist
  141.                         theans=""
  142.                    elif [ ! -w `dirname $theans` ]; then
  143.                         echo Directory `dirname $theans` isn\'t writable
  144.                         theans=""
  145.                    fi;;
  146.         *);;
  147.     esac
  148.   done
  149.  
  150. }
  151.  
  152. ##############################################################################
  153. # getAcceptDecline()
  154. # Gets either a "Accept" or a "Decline" in the traditional (a/d) pattern 
  155. #               $1      The default value if user hits <Enter> (TRUE/FALSE)
  156. #               $2      The string to print to prompt the user
  157. # The variable $AORD is set in accordance to what the user entered.
  158. ##############################################################################
  159. getAcceptDecline()
  160. {
  161. #####################################################
  162. # Set up line parameters as $1 and $2 are overwritten
  163. #####################################################
  164.   AorDdef=$1
  165.   AorDprompt=$2
  166.  
  167.   AORD=""
  168.   until [ -n "$AORD" ] ;
  169.   do
  170.     echo ""
  171.     echo_no_nl $AorDprompt
  172.     read AORD
  173.  
  174.     AORD=`echo $AORD | tr '[a-z]' '[A-Z]'`
  175.  
  176.     case "$AORD"
  177.     in
  178.       A|ACCEPT )  AORD=TRUE;;
  179.       D|DECLINE )  AORD=FALSE;;
  180.       ''  )  AORD=$AorDdef;;
  181.       *   )  echo ""
  182.              echo "Please enter 'A', 'D' or '<return>' "
  183.              AORD="";;
  184.     esac
  185.   done
  186.  
  187. }
  188.  
  189.  
  190. ##############################################################################
  191. # getyesorno()
  192. # Gets either a "yes" or a "no" in the traditional (y/n) pattern 
  193. #               $1      The default value if user hits <Enter> (TRUE/FALSE)
  194. #               $2      The string to print to prompt the user
  195. # The variable $YESORNO is set in accordance to what the user entered.
  196. ##############################################################################
  197. getyesorno()
  198. {
  199. #####################################################
  200. # Set up line parameters as $1 and $2 are overwritten
  201. #####################################################
  202.   yesornodef=$1
  203.   yesornoprompt=$2
  204.  
  205.   YESORNO=""
  206.   until [ -n "$YESORNO" ] ;
  207.   do
  208.     echo ""
  209.     echo_no_nl $yesornoprompt
  210.     read YESORNO
  211.  
  212.     case "$YESORNO"
  213.     in
  214.       y|Y )  YESORNO=TRUE;;
  215.       n|N )  YESORNO=FALSE;;
  216.       ''  )  YESORNO=$yesornodef;;
  217.       *   )  echo ""
  218.              echo "Please enter 'y', 'n' or '<return>' "
  219.              YESORNO="";;
  220.     esac
  221.   done
  222.  
  223. }
  224.  
  225.  
  226. ##############################################################################
  227. # abort_installation()
  228. # This subroutine removes files that were recently installed and restores
  229. # the previous installation files, if they existed.
  230. ##############################################################################
  231. abort_installation()
  232. {
  233. #CP__need to fix this when done. Make sure to set values for each file placed somewhere
  234. echo ""
  235.   echo "Aborting Installation..."
  236.   exit 1
  237. }
  238.  
  239.  
  240. ############################################################
  241. # Display the License and Copyright files.
  242. ############################################################
  243. startup_screen()
  244. {
  245.  
  246.     # Changed so that we could have both license files shown
  247.     if [ -f "$LICENSE" ] ; then
  248.         more "$LICENSE" 
  249.     else
  250.         echo "The License Agreement text file could not be found in the current directory."
  251.         echo "Installation is aborting..."
  252.             abort_installation
  253.     fi
  254.  
  255.      getAcceptDecline FALSE "Do you accept the License Terms and Conditions stated above? (Accept/Decline) [D]"
  256.     if [ "$AORD" = FALSE ] ; then
  257.     abort_installation;
  258.     fi
  259.     echo ""
  260.     echo ""
  261.     echo ""
  262. }
  263.  
  264. ############################################################
  265. # Check to see if the environment variable VAR_ACE is
  266. # defined and sdconf.rec exists
  267. ############################################################
  268. check_sdconf()
  269. {
  270. noerror=0
  271. #Removing  VAR_ACE check from environment  
  272. VAR_ACE="/var/ace"
  273. theans=""
  274. while [ "$theans" = "" ] 
  275. do
  276.     getfilename "Enter Directory where sdconf.rec is located" $VAR_ACE DIRECTORY
  277.     if [ ! -f "$theans/sdconf.rec" ]; then 
  278.     echo file "$theans/sdconf.rec" not found
  279.     theans=""
  280.     elif [ ! -r "$theans/sdconf.rec" ]; then
  281.     echo file "$theans/sdconf.rec" not readable: change protection if needed
  282.         VAR_ACE="$theans"
  283.     theans=""
  284.     else
  285.     if [ "$theans" != "" ]; then
  286.             VAR_ACE="$theans"
  287.     fi
  288.     break
  289.     fi
  290.     
  291. done
  292.  
  293. }
  294.  
  295. ############################################################
  296. # Check to see if this is a supported platform.
  297. ############################################################
  298. check_platform()
  299. {
  300. #echo "check_platform: uname is [$UNAME]"
  301. case $UNAME
  302.    in
  303.      'SunOS'  )  SUN_HARDWARE=`uname -p`
  304.         if [ `/usr/bin/isainfo -kv | cut -f 1 -d '-'` = "64" ] ; then
  305.             ARCH=64bit
  306.             MODULE_DIR_PRIMARY="/usr/lib/security"
  307.             MODULE_DIR_SECONDARY="/usr/lib/security/64"
  308.                 else
  309.             ARCH=32bit
  310.             MODULE_DIR_PRIMARY="/usr/lib/security"
  311.             MODULE_DIR_SECONDARY=""
  312.                 fi
  313.                 case "$SUN_HARDWARE" in
  314.                 'i386' )
  315.             WHOAMISOL=`/usr/ucb/whoami`
  316.                     OS_DIR="sol_x86" 
  317.             OS_EXT="so"
  318.             #
  319.             # Need this so grep handles extended expressions like '[[:space:]]'.
  320.             #
  321.             GREP="/usr/xpg4/bin/grep -E"
  322.  
  323.             USER_NAME=`echo $WHOAMISOL`;;
  324.         'sparc' )
  325.             WHOAMISOL=`/usr/ucb/whoami`
  326.                     OS_DIR="sparc" 
  327.             OS_EXT="so"
  328.             #
  329.             # Need this so grep handles extended expressions like '[[:space:]]'.
  330.             #
  331.             GREP="/usr/xpg4/bin/grep -E"
  332.  
  333.             USER_NAME=`echo $WHOAMISOL`;;
  334.                 esac;;
  335.  
  336.      'Linux' ) LNX_VERS=`uname -i`
  337.         if [ `getconf LONG_BIT` = "32" ] ; then
  338.             ARCH=32bit
  339.             MODULE_DIR_PRIMARY="/lib/security"
  340.             MODULE_DIR_SECONDARY=""
  341.         else
  342.             ARCH=64bit
  343.             MODULE_DIR_PRIMARY="/lib/security"
  344.             MODULE_DIR_SECONDARY="/lib64/security/"
  345.         fi
  346.         OS_DIR="lnx"
  347.         WHOAMILNX=`/usr/bin/whoami`
  348.         OS_EXT="so"
  349.         #
  350.             # Need this so that echo does the right thing with newlines.
  351.             #
  352.             ECHO="$ECHO -e"
  353.                 USER_NAME=`echo $WHOAMILNX`
  354.                 case "$LNX_VERS" in
  355.                 'x86_64' ) 
  356.                     echo "";;
  357.                  'i386' ) 
  358.                     echo "";;
  359.             
  360.                *   )  echo ""
  361.                     echo "Sorry, this is not a supported configureation"
  362.                     echo ""
  363.                     abort_installation ;;
  364.                 esac;;
  365.  
  366.      'HP-UX' ) 
  367.         if [ `getconf KERNEL_BITS` = "32" ] ; then
  368.              ARCH=32bit
  369.             MODULE_DIR_PRIMARY="/usr/lib/security/hpux32"
  370.             MODULE_DIR_SECONDARY=""
  371.         else
  372.             ARCH=64bit
  373.             MODULE_DIR_PRIMARY="/usr/lib/security/hpux32"
  374.             MODULE_DIR_SECONDARY="/usr/lib/security/hpux64"
  375.         fi
  376.         if [ `uname -m | grep "ia"` ] ; then
  377.               HP_VERS=hp_itanium
  378.             else
  379.               HP_VERS=hp_parisc
  380.         fi 
  381.                case "$HP_VERS" in
  382.            'hp_itanium' )
  383.            WHOAMIHP11=`/bin/whoami`
  384.                    OS_DIR="hp_itanium"
  385.                    OS_EXT="1"
  386.            PAM_AGENT_MODULE="pam_securid"
  387.            USER_NAME=`echo $WHOAMIHP11`;;
  388.  
  389.                * )
  390.            WHOAMIHP11=`/bin/whoami`
  391.                    echo ""
  392.                    echo "Sorry, this is not a supported configureation"
  393.                     echo ""
  394.            USER_NAME=`echo $WHOAMIHP11`;;
  395.                esac;;
  396.      
  397.      'AIX' ) AIX_VERS=`uname -vr | awk '{print $2 * 1000 + $1}'`
  398.         if [ `bootinfo -K` = "32" ] ; then
  399.                     ARCH=32bit
  400.             MODULE_DIR_PRIMARY="/usr/lib/security"
  401.             MODULE_DIR_SECONDARY=""
  402.                 else
  403.                     ARCH=64bit
  404.             MODULE_DIR_PRIMARY="/usr/lib/security"
  405.             MODULE_DIR_SECONDARY="/usr/lib/security/64"
  406.                 fi
  407.                 case "$AIX_VERS" in 
  408.             *)
  409.             OS_DIR="aix"
  410.                     OS_EXT="so"
  411.                     USER_NAME=`/usr/bin/whoami`
  412.                esac;; 
  413.      *   )  echo ""
  414.             echo "Sorry, $UNAME is not currently supported."
  415.             echo ""
  416.             abort_installation ;;
  417. esac
  418. }
  419.  
  420.  
  421. ############################################################
  422. # Ask the user for the destination of the Agent files and
  423. # other installation information, documentation
  424. ############################################################
  425. setup_paths()
  426. {
  427. ###########################################
  428. # Get the Agent directory path
  429. ###########################################
  430. theans=""
  431. DEFAULT_AGENT_ROOT="/opt"
  432. AGENT_ROOT=""
  433.  
  434. echo ""
  435. getfilename "Please enter the root path for the RSA Authentication Agent for PAM directory" $DEFAULT_AGENT_ROOT DIRECTORY
  436. if [ "$theans" = "" ]; then
  437.     theans="$DEFAULT_AGENT_ROOT"
  438. fi
  439. while [ -d "$theans/pam" ] 
  440. do
  441.     echo PAM Agent is already installed in the "$theans/pam"
  442.     getyesorno TRUE "Would you like to overwrite it? (y/n) [y]"
  443.     if [ "$YESORNO" = FALSE ] ; then
  444.         getfilename "Please enter the root path for the new RSA Authentication Agent for PAM directory" $DEFAULT_AGENT_ROOT DIRECTORY
  445.     else
  446.         AGENT_ROOT="$theans"
  447.         break
  448.     fi
  449. done
  450. if [ "$AGENT_ROOT" = "" ]; then
  451.     AGENT_ROOT="$theans"
  452. fi
  453.  
  454.  
  455. echo ""
  456. echo "The RSA Authentication Agent for PAM will be installed in the $AGENT_ROOT directory."
  457.  
  458. }
  459.  
  460. #################
  461. # Check PAM_CONFIG to see if it has a line that defines VARIABLE.
  462. # If so, do nothing.  If not, append ENTRY to the end of PAM_CONFIG.
  463. #################
  464. check_config_line()
  465. {
  466. VARIABLE=$1
  467. ENTRY=$2
  468.  
  469. if $GREP "^[[:space:]]*$VARIABLE[[:space:]]*=" $PAM_CONFIG > /dev/null; then
  470.     echo "$VARIABLE exists - entry will not be updated"
  471. else
  472.     echo "$VARIABLE does not exist - entry will be appended"
  473.     $ECHO "$ENTRY" >> "$PAM_CONFIG"
  474.     echo "" >> "$PAM_CONFIG"
  475.     echo "" >> "$PAM_CONFIG"
  476. fi
  477. }
  478.  
  479. #################
  480. # Create PAM config file
  481. #################
  482.  
  483. create_conf()
  484. {
  485. if [ -f "$PAM_CONFIG" ]; then
  486.     cp "$PAM_CONFIG" "$PAM_CONFIG".bak
  487. fi
  488.  
  489. touch "$PAM_CONFIG"
  490.  
  491. $ECHO "\nChecking $PAM_CONFIG:\n"
  492.  
  493. check_config_line VAR_ACE \
  494. "#VAR_ACE ::  the location where the sdconf.rec, sdstatus.12 and securid files will go\n\
  495. # default value is /var/ace\n\
  496. VAR_ACE=$VAR_ACE"
  497.  
  498. check_config_line RSATRACELEVEL \
  499. "#RSATRACELEVEL :: To enable logging in UNIX for securid authentication\n\
  500. #                   :: 0 Disable logging for securid authentication\n\
  501. #                   :: 1 Logs regular messages for securid authentication\n\
  502. #                   :: 2 Logs function entry points for securid authentication\n\
  503. #                   :: 4 Logs function exit points for securid authentication\n\
  504. #                   :: 8 All logic flow controls use this for securid authentication\n\
  505. # NOTE              :: For combinations, add the corresponding values\n\
  506. # default value is 0\n\
  507. RSATRACELEVEL=0"
  508.  
  509. check_config_line RSATRACEDEST \
  510. "#RSATRACEDEST :: Specify the file path where the logs are to be redirected for securid authentication.\n\
  511. #                   :: If this is not set, by default the logs go to Error output.\n\
  512. RSATRACEDEST="
  513.  
  514. check_config_line ENABLE_USERS_SUPPORT \
  515. "#ENABLE_USERS_SUPPORT :: 1 to enable; 0 to disable users support\n\
  516. # default value is 0\n\
  517. ENABLE_USERS_SUPPORT=0"
  518.  
  519. check_config_line INCL_EXCL_USERS \
  520. "#INCL_EXCL_USERS :: 0 exclude users from securid authentication\n\
  521. #                   :: 1 include users for  securid authentication\n\
  522. # default value is 0\n\
  523. INCL_EXCL_USERS=0"
  524.  
  525. check_config_line LIST_OF_USERS \
  526. "#LIST_OF_USERS :: a list of users to include or exclude from SecurID Authentication...Example:\n\
  527. LIST_OF_USERS=user1:user2"
  528.  
  529. check_config_line PAM_IGNORE_SUPPORT_FOR_USERS \
  530. "#PAM_IGNORE_SUPPORT_FOR_USERS :: 1 to return PAM_IGNORE if a user is not SecurID authenticated due to user exclusion support\n\
  531. #                   :: 0 to UNIX authenticate a user that is not SecurID authenticated due to user exclusion support\n\
  532. # default value is 0\n\
  533. PAM_IGNORE_SUPPORT_FOR_USERS=0"
  534.  
  535. check_config_line ENABLE_GROUP_SUPPORT \
  536. "#ENABLE_GROUP_SUPPORT :: 1 to enable; 0 to disable group support\n\
  537. # default value is 0\n\
  538. ENABLE_GROUP_SUPPORT=0"
  539.  
  540. check_config_line INCL_EXCL_GROUPS \
  541. "#INCL_EXCL_GROUPS :: 1 to always prompt the listed groups for securid authentication (include)\n\
  542. #                 :: 0 to never prompt the listed groups for securid authentication (exclude)\n\
  543. # default value is 0\n\
  544. INCL_EXCL_GROUPS=0"
  545.  
  546. check_config_line LIST_OF_GROUPS \
  547. "#LIST_OF_GROUPS :: a list of groups to include or exclude...Example\n\
  548. LIST_OF_GROUPS=other:wheel:eng:othergroupnames "
  549.  
  550. check_config_line PAM_IGNORE_SUPPORT \
  551. "#PAM_IGNORE_SUPPORT :: 1 to return PAM_IGNORE if a user is not SecurID authenticated due to their group membership\n\
  552. #                   :: 0 to UNIX authenticate a user that is not SecurID authenticated due to their group membership\n\
  553. # default value is 0\n\
  554. PAM_IGNORE_SUPPORT=0"
  555.  
  556. check_config_line AUTH_CHALLENGE_USERNAME_STR \
  557. "#AUTH_CHALLENGE_USERNAME_STR :: prompt message to ask user for their username/login id\n\
  558. AUTH_CHALLENGE_USERNAME_STR=Enter USERNAME :"
  559.  
  560. check_config_line AUTH_CHALLENGE_RESERVE_REQUEST_STR \
  561. "#AUTH_CHALLENGE_RESERVE_REQUEST_STR :: prompt message to ask administrator for their System password\n\
  562. AUTH_CHALLENGE_RESERVE_REQUEST_STR=Please enter System Password for root :"
  563.  
  564. check_config_line AUTH_CHALLENGE_PASSCODE_STR \
  565. "#AUTH_CHALLENGE_PASSCODE_STR :: prompt message to ask user for their Passcode\n\
  566. AUTH_CHALLENGE_PASSCODE_STR=Enter PASSCODE :"
  567.  
  568. check_config_line AUTH_CHALLENGE_PASSWORD_STR \
  569. "#AUTH_CHALLENGE_PASSWORD_STR :: prompt message to ask user for their Password\n\
  570. AUTH_CHALLENGE_PASSWORD_STR=Enter your PASSWORD :"
  571.  
  572. chmod 644 "$PAM_CONFIG" 
  573. }
  574.  
  575.  
  576. ############################################################
  577. # Install the RSA Authentication Agent 7.0 for PAM library and documentation.
  578. ############################################################
  579. install_pam_agent()
  580. {
  581. ##############
  582. #untar the RPM file
  583. ##############
  584.  
  585. cd $AGENT_ROOT/
  586. if [ -f "$HERE/$OS_DIR/$PAM_AGENT_TAR" ]; then
  587.     tar xvf "$HERE/$OS_DIR/$PAM_AGENT_TAR"
  588. elif [ -f "$HERE/$OS_DIR/$PAM_AGENT_TAR_GZ" ]; then
  589.     tar xzvf "$HERE/$OS_DIR/$PAM_AGENT_TAR_GZ"
  590. else
  591.     echo Error $HERE/$OS_DIR/$PAM_AGENT_TAR or $HERE/$OS_DIR/$PAM_AGENT_TAR_GZ does not exist
  592.     abort_installation
  593. fi
  594.  
  595. if  [ $ARCH = "32bit" ]; then
  596.         if [ -d "$AGENT_ROOT/pam/bin/64bit" ]; then
  597.                 rm -rf "$AGENT_ROOT/pam/bin/64bit"
  598.         fi
  599.         if [ -d "$AGENT_ROOT/pam/lib/64bit" ]; then
  600.                 rm -rf "$AGENT_ROOT/pam/lib/64bit"
  601.         fi
  602. fi
  603.  
  604. #if [ -d "$AGENT_ROOT/pam/$PAM_AGENT_DOC" ]; then
  605. #    cp  "$HERE/"*.pdf "$AGENT_ROOT/pam/$PAM_AGENT_DOC"
  606. #fi
  607. if  [ $ARCH = "64bit" ]; then
  608.     if [ "$OS_DIR" = "sparc" ] || [ "$OS_DIR" = "hp_itanium" ] || [ "$OS_DIR" = "lnx" ] 
  609.     then
  610.         if [ -f $AGENT_ROOT/pam/lib/$ARCH/$PAM_AGENT_MODULE.$OS_EXT ]; then
  611.             cp "$HERE/"uninstall* "$AGENT_ROOT/pam"
  612.             cp "$AGENT_ROOT/pam/lib/$ARCH/$PAM_AGENT_MODULE.$OS_EXT" "$MODULE_DIR_SECONDARY"
  613.             cp "$AGENT_ROOT/pam/lib/32bit/$PAM_AGENT_MODULE.$OS_EXT" "$MODULE_DIR_PRIMARY"
  614.                     chmod 755 "$MODULE_DIR_SECONDARY/$PAM_AGENT_MODULE.$OS_EXT"
  615.             chmod 755 "$MODULE_DIR_PRIMARY/$PAM_AGENT_MODULE.$OS_EXT"
  616.             else
  617.                    echo Error  Could not find $PAM_AGENT_MODULE.$OS_EXT in $AGENT_ROOT/pam/$OS_DIR directory.
  618.                 abort_installation
  619.         fi
  620.     else
  621.         if [ -f $AGENT_ROOT/pam/lib/32bit/$PAM_AGENT_MODULE.$OS_EXT ]; then
  622.             cp "$HERE/"uninstall* "$AGENT_ROOT/pam"
  623.             cp "$AGENT_ROOT/pam/lib/32bit/$PAM_AGENT_MODULE.$OS_EXT" "$MODULE_DIR_PRIMARY"
  624.             chmod 755 "$MODULE_DIR_PRIMARY/$PAM_AGENT_MODULE.$OS_EXT"
  625.         else
  626.             echo Error  Could not find $PAM_AGENT_MODULE.$OS_EXT in $AGENT_ROOT/pam/$OS_DIR directory.
  627.             abort_installation
  628.         fi
  629.     fi
  630. else
  631.     if [ -f $AGENT_ROOT/pam/lib/$ARCH/$PAM_AGENT_MODULE.$OS_EXT ]; then
  632.             cp "$HERE/"uninstall* "$AGENT_ROOT/pam"
  633.             cp "$AGENT_ROOT/pam/lib/$ARCH/$PAM_AGENT_MODULE.$OS_EXT" "$MODULE_DIR_PRIMARY"
  634.             chmod 755 "$MODULE_DIR_PRIMARY/$PAM_AGENT_MODULE.$OS_EXT"
  635.         else
  636.             echo Error Could not find $PAM_AGENT_MODULE.$OS_EXT in $AGENT_ROOT/pam/$OS_DIR directory.
  637.             abort_installation
  638.     fi
  639. fi
  640.                     
  641. cd "$HERE"
  642. chown -R root "$AGENT_ROOT/pam"
  643. chmod -R 700  "$AGENT_ROOT/pam"
  644.  
  645. }
  646.  
  647. check_user()
  648. {
  649. #########################
  650. # make sure user is root
  651. #########################
  652.  
  653. if [ "$USER_NAME" != root ]; then 
  654.     echo "You Must be ROOT to install this agent"
  655.     abort_installation
  656. fi
  657. }
  658.  
  659.  
  660. check_platform
  661. check_user
  662. startup_screen
  663. check_sdconf
  664. setup_paths
  665. install_pam_agent
  666. create_conf
  667.  
  668. echo ""
  669. echo "**********************************************************************"
  670. echo "* You have successfully installed RSA Authentication Agent 7.0 for PAM"
  671. echo "**********************************************************************"
  672. echo ""
  673.