PageRenderTime 46ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/rel/files/erl

http://github.com/AF83/ucengine
#! | 34 lines | 28 code | 6 blank | 0 comment | 0 complexity | 082d729c5defa0bde8fd6d0ffbebc35e MD5 | raw file
  1. #!/bin/bash
  2. ## This script replaces the default "erl" in erts-VSN/bin. This is necessary
  3. ## as escript depends on erl and in turn, erl depends on having access to a
  4. ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect
  5. ## of running escript -- the embedded node bypasses erl and uses erlexec directly
  6. ## (as it should).
  7. ##
  8. ## Note that this script makes the assumption that there is a start_clean.boot
  9. ## file available in $ROOTDIR/release/VSN.
  10. # Determine the abspath of where this script is executing from.
  11. ERTS_BIN_DIR=$(cd ${0%/*} && pwd)
  12. # Now determine the root directory -- this script runs from erts-VSN/bin,
  13. # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR
  14. # path.
  15. ROOTDIR=${ERTS_BIN_DIR%/*/*}
  16. # Parse out release and erts info
  17. START_ERL=`cat $ROOTDIR/releases/start_erl.data`
  18. ERTS_VSN=${START_ERL% *}
  19. APP_VSN=${START_ERL#* }
  20. BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
  21. EMU=beam
  22. PROGNAME=`echo $0 | sed 's/.*\\///'`
  23. CMD="$BINDIR/erlexec"
  24. export EMU
  25. export ROOTDIR
  26. export BINDIR
  27. export PROGNAME
  28. exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"}