-
Notifications
You must be signed in to change notification settings - Fork 13
/
perseo_core-entrypoint.sh
executable file
·39 lines (32 loc) · 1.46 KB
/
perseo_core-entrypoint.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
#!/bin/bash
# Copyright 2016 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of perseo-core
#
# perseo-core is free software: you can redistribute it and/or modify it under the terms of the GNU Affero
# General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# perseo-core is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
# for more details.
#
# You should have received a copy of the GNU Affero General Public License along with perseo-core. If not, see
# http://www.gnu.org/licenses/.
#
# For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
#
DEFAULT_PERSEO_FE_URL=perseo_fe_endpoint
PERSEO_FE_URL_ARG=${1}
PERSEO_FE_URL_VALUE=${2}
if [ "$PERSEO_FE_URL_ARG" == "-perseo_fe_url" ] && [ -z "$PERSEO_FE_URL" ]
then
export PERSEO_FE_URL="$PERSEO_FE_URL_VALUE"
fi
mkdir -p /var/log/perseo
touch /var/log/perseo/perseo-core.log
ln -snf /dev/stdout /var/log/perseo/perseo-core.log &
if [ "$PERSEO_LOG_LEVEL" ]; then
(sleep 10; curl -X PUT 'http://localhost:8080/perseo-core/admin/log?level='$PERSEO_LOG_LEVEL) &
fi
# We use tomcat from Apache, then will be started using catalina.sh, instead service tomcat
exec ${CATALINA_HOME}/bin/catalina.sh run