|
1 | 1 | #!/bin/bash |
2 | | -# Author: Gérald Fenoy |
3 | | -# Copyright GeoLabs 2021 |
4 | | -set -x |
5 | | -echo "hello" |
| 2 | +# |
| 3 | +# Author : Gérald FENOY |
| 4 | +# |
| 5 | +# Copyright 2021 GeoLabs SARL. All rights reserved. |
| 6 | +# |
| 7 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | +# of this software and associated documentation files (the "Software"), to deal |
| 9 | +# in the Software without restriction, including without limitation the rights |
| 10 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | +# copies of the Software, and to permit persons to whom the Software is |
| 12 | +# furnished to do so, subject to the following conditions: |
| 13 | +# |
| 14 | +# The above copyright notice and this permission notice shall be included in |
| 15 | +# all copies or substantial portions of the Software. |
| 16 | +# |
| 17 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | +# THE SOFTWARE. |
| 24 | + |
6 | 25 | mkdir -p /tmp/zTmp/statusInfos |
7 | | -cp /var/www/html/data/* /usr/com/zoo-project |
8 | | -chown www-data:www-data -R /tmp/zTmp /usr/com/zoo-project |
9 | | -chmod 777 -R /tmp/zTmp |
10 | 26 |
|
11 | | -CMD="curl -o toto.out {{ include "zoo-project-dru.rabbitmq.serviceName" . }}:15672" |
| 27 | +CMD="curl -o /tmp/toto.out {{ include "zoo-project-dru.rabbitmq.serviceName" . }}:15672" |
12 | 28 | $CMD |
13 | | -cat toto.out |
14 | | -if [ -e toto.out ]; then echo "Should start" ; else echo wait; sleep 1; $CMD ; fi |
15 | 29 |
|
16 | | -while [ ! -e toto.out ]; do echo wait; sleep 1; $CMD ; done |
| 30 | +if [ -e /tmp/toto.out ]; then echo "Should start" ; else echo wait; sleep 1; $CMD ; fi |
| 31 | + |
| 32 | +while [ ! -e /tmp/toto.out ]; do echo wait; sleep 1; $CMD ; done |
17 | 33 |
|
18 | 34 | {{- if not .Values.keda.enabled }} |
19 | 35 | echo "START FPM in 5 seconds" |
20 | 36 | sleep 5 |
21 | 37 | {{- end }} |
22 | 38 | rm toto.out |
23 | 39 |
|
24 | | -cd /usr/lib/cgi-bin |
25 | 40 | touch /var/log/zoofpm.log |
26 | | -chown www-data:www-data /var/log/zoofpm.log |
27 | | -su www-data -s /bin/bash -c "./zoo_loader_fpm ./main.cfg 2> /var/log/zoofpm.log >> /var/log/zoofpm.log" |
28 | 41 |
|
29 | | -echo "STARTING FPM DONE" |
| 42 | +if [ "$(id -u)" = "0" ]; then |
| 43 | + su www-data -s /bin/bash -c "cd /usr/lib/cgi-bin; ./zoo_loader_fpm ./main.cfg 2> /var/log/zoofpm.log >> /var/log/zoofpm.log" |
| 44 | +else |
| 45 | + cd /usr/lib/cgi-bin |
| 46 | + ./zoo_loader_fpm ./main.cfg 2> /var/log/zoofpm.log >> /var/log/zoofpm.log |
| 47 | +fi |
0 commit comments