check_setkey 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. ################################################################################
  3. ## ##
  4. ## Copyright (c) International Business Machines Corp., 2005 ##
  5. ## ##
  6. ## This program is free software; you can redistribute it and#or modify ##
  7. ## it under the terms of the GNU General Public License as published by ##
  8. ## the Free Software Foundation; either version 2 of the License, or ##
  9. ## (at your option) any later version. ##
  10. ## ##
  11. ## This program is distributed in the hope that it will be useful, but ##
  12. ## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
  13. ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
  14. ## for more details. ##
  15. ## ##
  16. ## You should have received a copy of the GNU General Public License ##
  17. ## along with this program; if not, write to the Free Software ##
  18. ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
  19. ## ##
  20. ## ##
  21. ################################################################################
  22. #
  23. # File:
  24. # check_setkey
  25. #
  26. # Description:
  27. # Check the local/remote host has setkey command
  28. #
  29. # Arguments:
  30. # None
  31. #
  32. # Returns:
  33. # 0: Both host have setkey command
  34. # 1: One or both host doesn't have setkey command
  35. #
  36. # Author:
  37. # Mitsuru Chinen <mitch@jp.ibm.com>
  38. #
  39. # History:
  40. # Oct 19 2005 - Created (Mitsuru Chinen)
  41. #
  42. #-----------------------------------------------------------------------
  43. #Uncomment line below for debug output.
  44. #trace_logic=${trace_logic:-"set -x"}
  45. $trace_logic
  46. # Make sure the value of LTPROOT
  47. LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
  48. export LTPROOT
  49. # Check the environmanet variable for the test
  50. . check_envval || exit 1
  51. which setkey >/dev/null 2>&1
  52. if [ $? -ne 0 ]; then
  53. echo "The local host does not have setkey command"
  54. exit 1
  55. fi
  56. ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH which setkey >/dev/null 2>&1 ; echo $?'`
  57. if [ $ret -ne 0 ]; then
  58. echo "The remote host does not have setkey command"
  59. exit 1
  60. fi