Be more quiet when upgrading cyrus databases and everything is OK
Ondřej Surý
12 years ago
28 | 28 | case "$1" in |
29 | 29 | configure) |
30 | 30 | if [ -f /usr/lib/cyrus/cyrus-db-types.active ]; then |
31 | set +e | |
32 | echo -n "cyrus-common: Upgrading database backends..." | |
33 | /usr/lib/cyrus/bin/upgrade-db | |
34 | case "$?" in | |
35 | 0) | |
36 | echo "done."; | |
31 | /usr/lib/cyrus/bin/upgrade-db || RET="$?" | |
32 | case "$RET" in | |
33 | 0) ;; | |
34 | 2) | |
35 | echo "ERROR: Upgrading of database backends failed." 1>&2 | |
36 | echo "ERROR: Please check the output, fix errors and re-run /usr/lib/cyrus/bin/upgrade-db" 1>&2 | |
37 | echo "ERROR: script, before trying to start cyrus-imapd." 1>&2 | |
37 | 38 | ;; |
38 | 2) | |
39 | echo "failed."; | |
40 | echo "ERROR: Please check the output, fix errors and re-run /usr/lib/cyrus/bin/upgrade-db"; | |
41 | echo "ERROR: script, before trying to start cyrus-imapd." | |
39 | 1|*) | |
40 | echo "ERROR: Upgrading of database backends failed with a fatal error." 1>&2 | |
41 | echo "ERROR: Please check /usr/share/doc/cyrus-common/README.Debian*" 1>&2 | |
42 | echo "ERROR: for instructions how to upgrade cyrus databases manually." 1>&2 | |
43 | exit $RET; | |
42 | 44 | ;; |
43 | 1|*) echo "fatal error."; exit 1 ;; | |
44 | 45 | esac |
45 | set -e | |
46 | 46 | fi |
47 | 47 | |
48 | 48 | # Legacy code / needed in case something will change in future |