File: wait_for_server_reply.sh

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (22 lines) | stat: -rwxr-xr-x 401 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# wait for server to start
set +e # ignore error 
count=0
while [ 1 ] ; do   
    sleep 3
    ecflow_client --ping 2> /dev/null
    if [[ $? == 0 ]] ; then
        echo "server up and running"
        break;
    fi
    count=$((count + 1))
    #echo $count
    if [ "$count" -gt "2" ] ; then
        echo "Timed out after 60 seconds"
        exit 1
    fi
done
set -e  # re-enable error