File: berrynet-manager

package info (click to toggle)
berrynet 3.10.2-2
  • links: PTS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,572 kB
  • sloc: python: 6,286; javascript: 2,373; xml: 1,094; sh: 738; makefile: 33
file content (57 lines) | stat: -rwxr-xr-x 1,802 bytes parent folder | download | duplicates (2)
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
54
55
56
57
#! /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_fast_server.service \
            agent.service \
            broker.service \
            dashboard.service \
            localimg.service \
            camera.service \
            journal.service \
            data_collector.service
        ;;
    log)
	sudo journalctl -x --no-pager -u detection_fast_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 data_collector.service
        ;;
    *)
        help
esac