Skip to content
This repository
Newer
Older
100644 29 lines (26 sloc) 1.047 kb
f88abd94 » Erik Søe Sørensen
2010-11-28 Environment (and other) configuration has been reworked; Erjang now u…
1 # Read and/or guess Erjang settings
2 PROP_FILE="$ERJANG_DIR/erjang_cfg.properties"
3 if [ -r "$PROP_FILE" ] ; then
4 shopt -s extglob # Used for trimming
5 # Parse properties file:
6 while s=""; read s || [ -n "$s" ] ; do
7 if [[ "$s" == "#"* ]] ; then continue; fi # Comment line
8 if [[ "$s" != *"="* ]] ; then continue; fi # No '='
9 propname=${s%%=*} ; propname=${propname%%*([[:space:]])}
10 propvalue=${s#*=} ; propvalue=${propvalue##*([[:space:]])}
075603fe » goj
2010-06-17 Shell script cleanup
11
f88abd94 » Erik Søe Sørensen
2010-11-28 Environment (and other) configuration has been reworked; Erjang now u…
12 # Set variable if it has the right prefix:
13 if [[ "$propname" == "erjang."* ]] ; then
14 varname=${propname//./_}
15 declare "$varname"="$propvalue"
16 fi
17 done < "$PROP_FILE"
075603fe » goj
2010-06-17 Shell script cleanup
18 fi
19
f88abd94 » Erik Søe Sørensen
2010-11-28 Environment (and other) configuration has been reworked; Erjang now u…
20 ## For listing parsed property names:
21 # echo "${!erjang*}"
075603fe » goj
2010-06-17 Shell script cleanup
22
f88abd94 » Erik Søe Sørensen
2010-11-28 Environment (and other) configuration has been reworked; Erjang now u…
23 ERL_ROOT=${erjang_otp_root:-/usr/lib/erlang}
24 if [ -r "$ERL_ROOT/releases/start_erl.data" ] ; then
25 ERTS_VSN_GUESS=$(awk '{print $1}' "$ERL_ROOT/releases/start_erl.data")
26 OTP_VSN_GUESS=$(awk '{print $2}' "$ERL_ROOT/releases/start_erl.data")
075603fe » goj
2010-06-17 Shell script cleanup
27 fi
f88abd94 » Erik Søe Sørensen
2010-11-28 Environment (and other) configuration has been reworked; Erjang now u…
28 ERTS_VSN=${erjang_erts_version:-$ERTS_VSN_GUESS}
29 OTP_VSN=${erjang_otp_version:-$OTP_VSN_GUESS}
Something went wrong with that request. Please try again.