/
oh2_dir_layout
38 lines (27 loc) · 912 Bytes
/
oh2_dir_layout
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
30
31
32
33
34
35
36
37
38
#!/bin/sh
# DIRNAME is the directory of karaf, setenv, etc.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
export OPENHAB_HOME=`cd "$DIRNAME/../.."; pwd`
if [ -z ${OPENHAB_CONF} ]; then
export OPENHAB_CONF="${OPENHAB_HOME}/conf"
fi
if [ -z ${OPENHAB_RUNTIME} ]; then
export OPENHAB_RUNTIME="${OPENHAB_HOME}/runtime"
fi
if [ -z ${OPENHAB_USERDATA} ]; then
export OPENHAB_USERDATA="${OPENHAB_HOME}/userdata"
fi
if [ -z ${OPENHAB_LOGDIR} ]; then
export OPENHAB_LOGDIR="${OPENHAB_USERDATA}/logs"
fi
if [ -z ${OPENHAB_BACKUP} ]; then
export OPENHAB_BACKUPS="${OPENHAB_HOME}/backups"
fi
# Make sure the tmp folder exists as Karaf requires it
if [ ! -d "${OPENHAB_USERDATA}/tmp" ]; then
mkdir "${OPENHAB_USERDATA}/tmp"
fi
export KARAF_HOME="${OPENHAB_RUNTIME}"
export KARAF_DATA="${OPENHAB_USERDATA}"
export KARAF_BASE="${OPENHAB_USERDATA}"
export KARAF_ETC="${OPENHAB_USERDATA}/etc"