/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/last_updated.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2012-07-14 17:44:09 UTC
  • Revision ID: csa@dside.dyndns.org-20120714174409-cuzsy4vupyjx9lia
Update of setups

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
 
 
4
srv="http://katrin.kit.edu/adei/"
 
5
setup="katrin"
 
6
 
 
7
function check {
 
8
    props=$1
 
9
    src=$2
 
10
    
 
11
    req="$srv/services/list.php?setup=$setup&target=groups&$props"
 
12
    res=`curl $req 2>/dev/null | xmllint --format - | grep "<Value" | sed -e "s/.*value=\"\([^\"]\+\)\".*name=\"\([^\"]\+\)\".*/\\1,\\2/"`
 
13
    for gr in $res; do
 
14
        grid=`echo $gr | cut -d ',' -f 1`
 
15
        grname=`echo $gr | cut -d ',' -f 2`
 
16
        
 
17
        req="$srv/services/list.php?setup=$setup&target=items&$props&db_group=$grid"
 
18
        lines=`curl $req 2>/dev/null | xmllint --format - | wc -l`
 
19
        req="$srv/services/getdata.php?setup=$setup&$props&db_group=$grid&window=-1&experiment=-&db_mask=0" 
 
20
        updated=`curl $req 2>/dev/null | tail -n 1 | cut -d ',' -f 1`
 
21
        echo "$src  $grname    Channels: $lines, Updated: $updated"
 
22
    done
 
23
}
 
24
 
 
25
check "db_server=fpd&db_name=katrin_rep" "FPD"
 
26
check "db_server=msz&db_name=Monitorspeczeus_rep" "MOS"
 
27
check "db_server=msz&db_name=aircoils_rep" "AC "