repo.or.cz
/
GalaxyCodeBases.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
new file: makefile
[GalaxyCodeBases.git]
/
bash
/
etc
/
runserv.sh
blob
8faa5f6b412337f94f76f36c80599c3b1e4694b5
1
#!/bin/bash
2
3
DIR
=
$
(/
usr
/
bin
/
dirname
"
${0}
"
)
4
5
mystart
()
6
{
7
cd
${DIR}
8
php
-q
bgprocess.php
</
dev
/
null
>
logfile.log
&
9
echo
$
! >
bg
.pid
10
}
11
12
case
"
$1
"
in
13
start
)
14
mystart
15
;;
16
stop
)
17
cd
${DIR}
18
mypid
=
`cat bg.pid`
19
var2
=
`ps xu | grep
$mypid
| wc -l`
20
if
[
"
$var2
"
-gt
0
]
21
then
22
kill
$mypid
23
fi
24
;;
25
check
)
26
# check if the process is running.
27
cd
${DIR}
28
mypid
=
`cat bg.pid`
29
var2
=
`ps xu | grep
$mypid
| wc -l`
30
if
[
"
$var2
"
-lt
1
]
31
then
32
mystart
33
fi
34
;;
35
esac
36
37
exit
0
;