Revision 10c5c1c3 daemons/daemon-util.in
b/daemons/daemon-util.in | ||
---|---|---|
51 | 51 |
return 0 |
52 | 52 |
} |
53 | 53 |
|
54 |
# Checks the exit code of a daemon |
|
55 |
check_exitcode() { |
|
56 |
if [[ "$#" -lt 1 ]]; then |
|
57 |
echo 'Missing exit code.' >&2 |
|
58 |
return 1 |
|
59 |
fi |
|
60 |
|
|
61 |
local rc="$1"; shift |
|
62 |
|
|
63 |
case "$rc" in |
|
64 |
0) ;; |
|
65 |
11) |
|
66 |
echo "not master" |
|
67 |
;; |
|
68 |
*) |
|
69 |
echo "exit code $rc" |
|
70 |
return 1 |
|
71 |
;; |
|
72 |
esac |
|
73 |
|
|
74 |
return 0 |
|
75 |
} |
|
76 |
|
|
54 | 77 |
# Checks whether daemon is running |
55 | 78 |
check() { |
56 | 79 |
if [[ "$#" -lt 1 ]]; then |
Also available in: Unified diff