-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.sh
executable file
·78 lines (60 loc) · 5.5 KB
/
configure.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
70
71
72
#!/bin/bash
CURDIR=$(pwd)/
JDK=jdk11
TOMCAT=Tomcat9
JAVA_DIR=$(echo $CURDIR | sed -e 's/ /\\ /g')$JDK/
#echo $JAVA_DIR
#echo $CURDIR
# tomcat config
echo "Coniguring iMediX Web"
echo "---------------------"
sed -i -e "/JAVA_HOME/s/=.*/=$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/bin/catalina.sh"
sed -i -e "/JRE_HOME/s/=.*/=$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/bin/catalina.sh"
blip="127.0.0.1"
gblroot="$CURDIR/$TOMCAT"
gblhome="https://localhost/iMediXcare"
gbltemp="$CURDIR/$TOMCAT/webapps/iMediXcare/temp"
EmailURL=""
SMSURL=""
vidServerUrl="meet.jit.si"
sed -i -e "/blip/s/=.*/= $(echo $blip | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/gblroot/s/=.*/= $(echo $gblroot | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/gblhome/s/=.*/= $(echo $gblhome | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/gbltemp/s/=.*/= $(echo $gbltemp | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/EmailURL/s/=.*/= $(echo $EmailURL | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/SMSURL/s/=.*/= $(echo $SMSURL | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
sed -i -e "/vidServerUrl/s/=.*/= $(echo $vidServerUrl | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/\./\\./g')/" "$CURDIR/$TOMCAT/webapps/iMediXcare/config.info"
# BL config
echo "Coniguring iMediX Business Logic"
echo "--------------------------------"
gbldbhost="127.0.0.1"
gbldbport=3306
read -p "Database name [imedixdb4]: " gbldbname
gbldbname=${gbldbname:-imedixdb4}
read -p "Database username [imedix]: " gbldbuser
gbldbuser=${gbldbuser:-imedix}
read -p "Database password [imedix12]: " gbldbpasswd
gbldbpasswd=${gbldbpasswd:-imedix12}
sed -i -e "/gbldbusername/s/=.*/= $(echo $gbldbuser | sed -e 's/\//\\\//g ; s/\./\\./g')/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "/gbldbpasswd/s/=.*/= $(echo $gbldbpasswd | sed -e 's/\//\\\//g ; s/\./\\./g')/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "/gbldburl/s/=.*/= jdbc:mysql:\/\/$(echo $gbldbhost | sed -e 's/\//\\\//g ; s/\./\\./g'):$(echo $gbldbport | sed -e 's/\//\\\//g ; s/\./\\./g')\/$(echo $gbldbname | sed -e 's/\//\\\//g ; s/\./\\./g')/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "/tempdatadir/s/=.*/= $(echo $gblbase | sed -e 's/\//\\\//g ; s/\./\\./g')\/serverApp\/temp/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "/SystemLoggerPath/s/=.*/= $(echo $gblbase | sed -e 's/\//\\\//g ; s/\./\\./g')\/serverApp\/SystemLog/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "/GeneralSqlLogPath/s/=.*/= $(echo $gblbase | sed -e 's/\//\\\//g ; s/\./\\./g')\/serverApp\/GenSqlLog/" "$CURDIR/iMediX-BL/gblinfo.inf"
sed -i -e "s/^.*\/java/$(echo $JAVA_DIR | sed -e 's/\//\\\//g ; s/ /\\ /g')bin\/java/g" "$CURDIR/iMediX-BL/RunServer.sh"
# source config (Server module)
echo "Coniguring iMediX Source Code (Server Module)"
echo "---------------------------------------------"
sed -i -e "s/^.*\.java$/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/javac -classpath \".:$(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')External_library\/*:\" -d \`pwd\` *\.java/g" "$CURDIR/SOURCECODES/server_module_source_code/makeJar.sh"
sed -i -e "s/^.*\/jar/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/jar/g" "$CURDIR/SOURCECODES/server_module_source_code/makeJar.sh"
sed -i -e "s/^.*\/rmic/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/rmic/g" "$CURDIR/SOURCECODES/server_module_source_code/makeJar.sh"
sed -i -e "s/^.*\/lib\//cp *.jar $(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')iMediX-BL\/lib\//g" "$CURDIR/SOURCECODES/server_module_source_code/makeJar.sh"
sed -i -e "s/^.*\/iMediX-BL\/$/cp iMediXBusinessLogic.jar $(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')iMediX-BL\//g" "$CURDIR/SOURCECODES/server_module_source_code/makeJar.sh"
# source config (tomcat module)
echo "Coniguring iMediX Source Code (Tomcat Module)"
echo "---------------------------------------------"
sed -i -e "s/^.*\/imedix\b/cp -r $(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')SOURCECODES\/server_module_source_code\/imedix/g" "$CURDIR/SOURCECODES/tomcat_module_source_code/WEB-INF/classes/src/makeJar.sh"
sed -i -e "s/^.*\`pwd\`[[:space:]]\*\.java$/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/javac -classpath \".:$(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')External_library\/*:\" -d \`pwd\` *\.java /g" "$CURDIR/SOURCECODES/tomcat_module_source_code/WEB-INF/classes/src/makeJar.sh"
sed -i -e "s/^.*\`pwd\`\/src_servlet[[:space:]]\*\.java$/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/javac -classpath \".:$(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')External_library\/*:\" -d \`pwd\`\/src_servlet *\.java /g" "$CURDIR/SOURCECODES/tomcat_module_source_code/WEB-INF/classes/src/makeJar.sh"
sed -i -e "s/^.*\/jar/$(echo $JAVA_DIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')bin\/jar/g" "$CURDIR/SOURCECODES/tomcat_module_source_code/WEB-INF/classes/src/makeJar.sh"
sed -i -e "s/^.*\/lib/cp -r *.jar $(echo $CURDIR | sed -e 's/ /\\ /g ; s/\//\\\//g ; s/ /\\ /g')$TOMCAT\/webapps\/iMediXcare\/WEB-INF\/lib/g" "$CURDIR/SOURCECODES/tomcat_module_source_code/WEB-INF/classes/src/makeJar.sh"