PageRenderTime 122ms CodeModel.GetById 80ms app.highlight 2ms RepoModel.GetById 38ms app.codeStats 1ms

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