summaryrefslogtreecommitdiffstats
path: root/network/geomyidae/rc.geomyidae.new
blob: df491581d56e3baa64c890ba71fa03876ab3ada7 (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
25
26
27
28
29
#!/bin/sh

# Array of all PIDS
PID=($(pidof -o %PPID /usr/bin/geomyidae))

case "$1" in
    start)
        echo "Starting geomyidae"
        /usr/bin/geomyidae $GEOMYIDAE_ARGS 2>&1
        if [ $? -gt 0 ]; then
            echo "Startup failed"
        fi
        ;;
    stop)
        echo "Stopping all geomyidae processes"
        [ -n "$PID" ] && kill ${PID[@]} >/dev/null
        if [ $? -gt 0 ] && [ -n "$PID" ]; then
            echo "Stopping failed for at least one process"
        fi
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "usage: $0 {start|stop|restart}"
esac
exit 0