summaryrefslogtreecommitdiff
blob: a614bd0bd4a167499adf23a2ce93c064906810f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/sbin/openrc-run

depend() {
        need net
}

start() {
        ebegin "Starting monitorix"
        start-stop-daemon --start --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid -- -c /etc/monitorix/monitorix.conf -p /var/run/monitorix.pid
        local i=0
        local timeout=5
        while [ ! -f /var/run/monitorix.pid ] && [ $i -le $timeout ]; do
                sleep 1
                i=$(($i + 1))
        done
        [ $timeout -gt $i ]
        eend $?
}

stop() {
        ebegin "Stopping monitorix"
        start-stop-daemon --stop --signal QUIT --stop --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid
        eend $?
}