mmldif.in 2.3 KB

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