forked from informatici/openhospital-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
69 lines (57 loc) · 1.62 KB
/
startup.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
######## Environment check:
# check for java home
JAVA_EXE=$JAVA_HOME/bin/java
if [ -z $JAVA_HOME ]; then
echo "JAVA_HOME not found. Please set it up properly."
JAVA_EXE=java
fi
######## OPENHOSPITAL Configuration:
# add the libraries to the OPENHOSPITAL_CLASSPATH.
# EXEDIR is the directory where this executable is.
EXEDIR=${0%/*}
DIRLIBS=${EXEDIR}/bin/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/*.zip
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
OPENHOSPITAL_CLASSPATH="${EXEDIR}/../classes":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_CLASSPATH="${EXEDIR}/bundle":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_CLASSPATH="${EXEDIR}/rpt":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_CLASSPATH="${EXEDIR}":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_HOME="${EXEDIR}"
ARCH=$(uname -m)
case $ARCH in
x86_64|amd64|AMD64)
NATIVE_LIB_PATH=${OPENHOSPITAL_HOME}/lib/native/Linux/amd64
;;
i[3456789]86|x86|i86pc)
NATIVE_LIB_PATH=${OPENHOSPITAL_HOME}/lib/native/Linux/i386
;;
*)
echo "Unknown architecture $(uname -m)"
;;
esac
$JAVA_EXE -Dsun.java2d.dpiaware=false -Djava.library.path=${NATIVE_LIB_PATH} -classpath "$OPENHOSPITAL_CLASSPATH:$CLASSPATH" org.isf.menu.gui.Menu "$@"