Last change
on this file was
2,
checked in by oldcode, 24 years ago
|
Initial revision
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | err () { |
---|
4 | echo "*********** ERROR **********" 1>&2 |
---|
5 | echo "`basename $0`: $@" 1>&2 |
---|
6 | exit 1 |
---|
7 | } |
---|
8 | |
---|
9 | seperator() { |
---|
10 | echo '' |
---|
11 | echo '*****************************' |
---|
12 | } |
---|
13 | |
---|
14 | chooser="/tmp/arb_pids_${USER}_*" |
---|
15 | |
---|
16 | echo '*****************************' |
---|
17 | echo "********* P A N I C *********" |
---|
18 | echo '*****************************' |
---|
19 | echo "" |
---|
20 | echo " This Module tries to save a running database" |
---|
21 | echo " There may be more than database server (ARB_NT):" |
---|
22 | echo " --------------------------------" |
---|
23 | |
---|
24 | for i in $chooser ; do |
---|
25 | /bin/echo " - >" `ls $i` "<"; |
---|
26 | done |
---|
27 | echo " --------------------------------" |
---|
28 | |
---|
29 | echo "Please choose one line and enter the rightmost number" |
---|
30 | |
---|
31 | read ARB_PID |
---|
32 | if [ ! -f /tmp/arb_pids_${USER}_${ARB_PID} ]; then |
---|
33 | err "Incorrect Choice" |
---|
34 | fi |
---|
35 | |
---|
36 | seperator |
---|
37 | echo "Please enter file name (full path):" |
---|
38 | read FILE |
---|
39 | |
---|
40 | panicfile="/tmp/arb_panic_${USER}_${ARB_PID}" |
---|
41 | rm -f $panicfile |
---|
42 | echo "$FILE" >$panicfile |
---|
43 | ok=false |
---|
44 | for i in `cat /tmp/arb_pids_${USER}_${ARB_PID}`; do |
---|
45 | if kill -1 $i 2>/dev/null; then |
---|
46 | ok=true |
---|
47 | break |
---|
48 | fi |
---|
49 | done |
---|
50 | if [ "$ok" = "false" ]; then |
---|
51 | err "Sorry could not find a running server" |
---|
52 | fi |
---|
53 | seperator |
---|
54 | echo "Wait until database is saved (1000 sequences == 1min ) or press <ctrl-c> to abort" |
---|
55 | while [ -f $panicfile ]; do |
---|
56 | sleep 1 |
---|
57 | echo " waiting" |
---|
58 | done |
---|
59 | |
---|
60 | seperator |
---|
61 | echo "enter 'kill' if you want to kill the server and its clients" |
---|
62 | read ki |
---|
63 | if [ "$ki" = "kill" ] ; then |
---|
64 | arb_clean |
---|
65 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.