/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/system/cacher.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2018-03-24 02:39:36 UTC
  • Revision ID: csa@suren.me-20180324023936-xlaudydvfht0reww
Respect HTTP errors in cacher script

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
shopt -s nocasematch
37
37
 
38
38
while [ $run -eq 1 ]; do
39
 
    src=$(curl $ADEI_SCHEDULER_URL 2>/dev/null)
 
39
    src=$(curl -sf $ADEI_SCHEDULER_URL)
 
40
    err=$?
 
41
    
40
42
    date=$(date -Iseconds)
41
 
    if [ -d /adei/cfg -a ! -f "/adei/cfg/.ready" ]; then
 
43
    if [ $err -ne 0 ]; then
 
44
        err=$(curl -f $ADEI_SCHEDULER_URL 2>&1)
 
45
        echo "$date Scheduling error at $ADEI_SCHEDULER_URL"
 
46
        echo "$date $err"
 
47
        sleep "$ADEI_ERROR_SLEEP"
 
48
    elif [ -d /adei/cfg -a ! -f "/adei/cfg/.ready" ]; then
42
49
        echo "$date ADEI is not ready yet. Idling..."
43
50
        sleep "$ADEI_IDLE_SLEEP"
44
51
    elif [ ! -f "$ADEI_PATH/config.php" -o ! -e "$ADEI_PATH/config.actual.php" -o ! -f "$ADEI_PATH/setups/$ADEI_SETUP/config.php" ]; then