forked from ome/omero-server-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_dropbox.sh
executable file
·38 lines (33 loc) · 894 Bytes
/
test_dropbox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -e
set -u
set -x
# Must be exported by the caller:
# OMERO_USER OMERO_PASS PREFIX
OMERO=/opt/omero/server/venv3/bin/omero
FILENAME=$(date +%Y%m%d-%H%M%S-%N).fake
SERVER=localhost:4064
docker exec $PREFIX-server sh -c \
"mkdir -p /OMERO/DropBox/root && touch /OMERO/DropBox/root/$FILENAME"
echo -n "Checking for imported DropBox image $FILENAME "
# Retry for 4 mins
i=0
result=
while [ $i -lt 60 ]; do
sleep 4
result=$(docker exec $PREFIX-server $OMERO hql -q -s $SERVER -u $OMERO_USER -w $OMERO_PASS "SELECT COUNT (*) FROM Image WHERE name='$FILENAME'" --style plain)
if [ "$result" = "0,1" ]; then
echo
echo "Found image: $result"
exit 0
fi
if [ "$result" != "0,0" ]; then
echo
echo "Unexpected query result: $result"
exit 2
fi
echo -n "."
let ++i
done
echo "Failed to find image"
exit 2