ldap-agent.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. ###############################################################################
  3. ## (1) Specify variables used by this script. ##
  4. ###############################################################################
  5. LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@netsnmp_libdir@
  6. BIN_DIR=@bindir@
  7. COMMAND=ldap-agent-bin
  8. # We don't need to load any mibs, so set MIBS to nothing.
  9. MIBS=
  10. export MIBS
  11. ###############################################################################
  12. ## (2) Set the LD_LIBRARY_PATH environment variable to determine the ##
  13. ## search order this command wrapper uses to find shared libraries. ##
  14. ###############################################################################
  15. LD_LIBRARY_PATH=${LIB_DIR}
  16. export LD_LIBRARY_PATH
  17. ###############################################################################
  18. ## (3) Set the PATH environment variable to determine the search ##
  19. ## order this command wrapper uses to find binary executables. ##
  20. ## ##
  21. ## NOTE: Since the wrappers themselves are ALWAYS located in ##
  22. ## "/usr/bin", this directory will always be excluded ##
  23. ## from the search path. Since "/bin" is nothing more ##
  24. ## than a symbolic link to "/usr/bin" on Solaris, this ##
  25. ## directory will also always be excluded from the search ##
  26. ## path on this platform. ##
  27. ###############################################################################
  28. PATH=${BIN_DIR}
  29. export PATH
  30. ###############################################################################
  31. ## (4) Execute the binary executable specified by this command wrapper ##
  32. ## based upon the preset LD_LIBRARY_PATH and PATH environment variables.##
  33. ###############################################################################
  34. ORIGINAL_IFS=${IFS}
  35. IFS=:
  36. for dir in ${PATH}
  37. do
  38. if [ -x ${dir}/${COMMAND} ]
  39. then
  40. IFS=${ORIGINAL_IFS}
  41. ${dir}/${COMMAND} "$@"
  42. exit $?
  43. fi
  44. done
  45. echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!"
  46. exit 255