ldif.in 2.2 KB

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