forked from gotthardp/lorawan-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlorawan-server
More file actions
executable file
·29 lines (26 loc) · 941 Bytes
/
Copy pathlorawan-server
File metadata and controls
executable file
·29 lines (26 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
SCRIPT=$(readlink $0 || true)
if [ -z $SCRIPT ]; then
SCRIPT=$0
fi
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"
if [ -z $LORAWAN_HOME ]; then
LORAWAN_HOME=$ROOT_DIR
fi
__possible_sys="$ROOT_DIR/releases/{{release_version}}/sys.config"
if [ -f "$__possible_sys" ]; then
SYS_CONFIG="$__possible_sys"
elif [ -L "$__possible_sys".orig ]; then
mv "$__possible_sys".orig "$__possible_sys"
SYS_CONFIG="$__possible_sys"
fi
if [ ! -z $LORAWAN_LOG_ROOT ]; then
ERL_ARGS="-lager log_root \"$LORAWAN_LOG_ROOT\""
else
ERL_ARGS="-lager log_root \"log\""
fi
if [ ! -z $GOOGLE_MAPS_KEY ]; then
sed -i "s/GoogleMapsKey = \"[-a-zA-Z0-9]*\"/GoogleMapsKey = \"$GOOGLE_MAPS_KEY\"/g" $ROOT_DIR/lib/lorawan_server-*/priv/admin/admin-config.js
fi
cd $LORAWAN_HOME && erl -noinput +Bd -sname lorawan -pa $ROOT_DIR/lib/*/ebin -s lorawan_app $ERL_ARGS -config $SYS_CONFIG $@