-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathrun
More file actions
36 lines (31 loc) · 880 Bytes
/
run
File metadata and controls
36 lines (31 loc) · 880 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
30
31
32
33
34
35
36
#!/bin/bash
MONO_PREFIX=/opt/mono-2.11
export MONO_PATH=$MONO_PREFIX/lib
export PATH=$MONO_PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig
export LD_LIBRARY_PATH=$MONO_PREFIX/lib
export MONO_LOG_LEVEL=error
DIR=`cd "$(dirname "$0")"; pwd`
SERVICE_WORKINGDIR=`cd ${DIR}/Service/bin/Release/; pwd`
# compile
$MONO_PREFIX/bin/xbuild Service/Service.sln /p:Configuration=Release /flp:LogFile=msbuild.log
# stop service if needed
SLOCK=/tmp/service.lock
if [ -f ${SLOCK} ];
then
echo Sopping Service...
SPID=`cat ${SLOCK}`
while [ -f ${SLOCK} ] && kill ${SPID}; do
sleep 0.5
done
if [ -f ${SLOCK} ];
then
rm -f ${SLOCK}
fi
fi
# run service using port 8090
$MONO_PREFIX/bin/mono-service -m:service -d:${SERVICE_WORKINGDIR} -l:${SLOCK} ${SERVICE_WORKINGDIR}/Service.exe &
# run site using port 8080
cd Site
npm link
npm start