-
-
Notifications
You must be signed in to change notification settings - Fork 230
/
berrynet-manager
executable file
·50 lines (47 loc) · 1.61 KB
/
berrynet-manager
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
#! /bin/sh
#
# Copyright 2017 DT42
#
# This file is part of BerryNet.
#
# BerryNet 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.
#
# BerryNet 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 BerryNet. If not, see <http://www.gnu.org/licenses/>.
help() {
echo "Usage: $0 <start | stop | status | log>"
echo " start : launch dlsystem"
echo " stop : terminate dlsystem"
echo " status : check the state of all services"
echo " log : dump logfiles of all services"
exit 1
}
if [ $# -lt 1 ]
then
help
fi
case $1 in
start | stop | status)
sudo systemctl $1 detection_server.service agent.service broker.service dashboard.service localimg.service camera.service journal.service cleaner.timer
;;
log)
sudo journalctl -x --no-pager -u detection_server.service
sudo journalctl -x --no-pager -u agent.service
sudo journalctl -x --no-pager -u broker.service
sudo journalctl -x --no-pager -u dashboard.service
sudo journalctl -x --no-pager -u localimg.service
sudo journalctl -x --no-pager -u camera.service
sudo journalctl -x --no-pager -u journal.service
sudo journalctl -x --no-pager -u cleaner.timer
;;
*)
help
esac