-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all.sh
55 lines (46 loc) · 1.41 KB
/
run_all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Copyright (c) 2016 S-BEAT GbR and others
#
# This file is part of S-BEAT.
#
# S-BEAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# S-BEAT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with S-BEAT. If not, see <http://www.gnu.org/licenses/>.
if [ -f data/request_stop.txt ]; then
echo "data/request_stop.txt found"
rm data/request_stop.txt
if [ -f data/run_all.pid ]; then
echo "data/run_all.pid found"
pid=`cat data/run_all.pid`
if [ -e /proc/${pid} ]; then
echo "data/run_all.pid ${pid} is running, trying to stop it"
kill -2 $pid
fi
fi
exit
fi
if [ ! -f data/request_start.txt ]; then
echo "data/request_start.txt does not exist"
exit
fi
rm data/request_start.txt
if [ -f data/run_all.pid ]; then
echo "data/run_all.pid does already exist"
pid=`cat data/run_all.pid`
if [ -e /proc/${pid} ]; then
echo "data/run_all.pid ${pid} is running"
exit
fi
fi
echo $$ > data/run_all.pid
python sbeat.py run_all
rm data/run_all.pid