Revision 25637,
944 bytes
checked in by jdreed, 12 years ago
(diff) |
In verify:
* Initial release.
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | statfile=/var/lib/verify_ws-status |
---|
4 | nologinfile=/var/run/athena-nologin |
---|
5 | updstatus=unknown |
---|
6 | updmsg=unknown |
---|
7 | |
---|
8 | [ -e /var/run/athena-login ] && exit || touch $nologinfile |
---|
9 | |
---|
10 | save_state() { |
---|
11 | rm -f $statfile |
---|
12 | echo "$(date +"%s")|$updstatus|$updmsg" > $statfile |
---|
13 | } |
---|
14 | |
---|
15 | cleanup() { |
---|
16 | rm -f $nologinfile |
---|
17 | save_state |
---|
18 | exit |
---|
19 | } |
---|
20 | |
---|
21 | trap cleanup EXIT |
---|
22 | |
---|
23 | fail() { |
---|
24 | logger -t "verify_ws" -p user.notice "$*" |
---|
25 | updstatus=failed |
---|
26 | updmsg="$*" |
---|
27 | exit |
---|
28 | } |
---|
29 | |
---|
30 | warn() { |
---|
31 | updstatus=warning |
---|
32 | updmsg="$*" |
---|
33 | exit |
---|
34 | } |
---|
35 | |
---|
36 | succeed() { |
---|
37 | updstatus=ok |
---|
38 | updmsg="$*" |
---|
39 | exit |
---|
40 | } |
---|
41 | |
---|
42 | if ! [ -x /usr/lib/debathena-verify/verify_ws.pl ]; then |
---|
43 | fail "Can't execute /usr/lib/debathena-verify/verify_ws.pl" |
---|
44 | fi |
---|
45 | |
---|
46 | if /usr/lib/debathena-verify/verify_ws.pl; then |
---|
47 | succeed "Verification passed" |
---|
48 | else |
---|
49 | case $? in |
---|
50 | 1) |
---|
51 | fail "Verification failed" |
---|
52 | ;; |
---|
53 | 2) |
---|
54 | warn "Non-fatal errors found" |
---|
55 | ;; |
---|
56 | *) |
---|
57 | fail "unknown error" |
---|
58 | ;; |
---|
59 | esac |
---|
60 | fi |
---|
61 | exit |
---|
Note: See
TracBrowser
for help on using the repository browser.