/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to scripts/cron/adei_manager.cron.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2018-03-21 16:21:54 UTC
  • Revision ID: csa@suren.me-20180321162154-w138wtbfi1uy8ma3
Various improvements for OpenShift operation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/bash
2
2
 
3
3
ADEI_PATH=${ADEI_PATH:-/srv/www/htdocs/adei}
 
4
ADEI_ADMIN=${ADEI_ADMIN:-0}
 
5
 
 
6
date=$(date -Iseconds)
4
7
 
5
8
function process_setup {
6
9
    setup="$1"
18
21
        return
19
22
    fi
20
23
 
 
24
    if [ "$ADEI_ADMIN" -ne 1 -a -f "setups/$setup/.debug" ]; then
 
25
        echo "$date ADEI setup $setup is under debug, skipping..."
 
26
        return
 
27
    fi
 
28
 
21
29
    if [ -f setups/$setup/adei_manager.cron.sh ]; then
22
30
        setups/$setup/adei_manager.cron.sh
23
31
        return
34
42
 
35
43
[ -f /adei/env ] && . /adei/env
36
44
 
 
45
 
 
46
if [ "$ADEI_ADMIN" -ne 1 -a -f "/adei/cfg/.debug" ]; then
 
47
    echo "$date ADEI is under debug, skipping..."
 
48
    exit
 
49
fi
 
50
 
 
51
 
37
52
script=$( cd $(dirname "$0") && pwd )/$( basename "$0" )
38
53
if [ -f /adei/sys/adei_manager.cron.sh -a "$script" != /adei/sys/adei_manager.cron.sh ]; then
39
54
    /adei/sys/adei_manager.cron.sh
42
57
 
43
58
(
44
59
    cd "$ADEI_PATH"
 
60
    
 
61
    for name in $(find tmp/adminscripts -mindepth 1 -maxdepth 1); do
 
62
        echo "$date Processing administrative script $(basename $name)" 
 
63
        php "$name" && rm "$name"
 
64
    done
45
65
 
46
66
    if [ -n "$ADEI_SETUP" -o -n "$ADEI_ENABLED_SETUPS" ]; then
47
67
        if [ "$ADEI_SETUP" = "all" ]; then