summaryrefslogtreecommitdiff
path: root/ucs-3.x/15-check-john-doe-sieve.sh
blob: acb4e69f9c9f034a35641463dbbacafa5ec6fc57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

eval "$(ucr shell)"

retval=$(./*-create-user-john-doe.sh >/dev/null 2>&1; echo $?)

if [ $retval -ne 0 ]; then
    echo "SKIP: prerequisite test $(ls -1 *-create-user-john-doe*) has failed"
    exit 1
fi

scripts=$(kolab sieve list doe@example.org 2>/dev/null | wc -l)
retval=$?

if [ $retval -ne 0 ]; then
    echo "FAIL: kolab sieve list failed"
    exit 1
elif [ $scripts -ne 3 ]; then
    echo "FAIL: Not three Sieve scripts created"
    exit 2
else
    echo "OK: 3 Sieve scripts created"
    exit 0
fi