summaryrefslogtreecommitdiffstats
path: root/network/geomyidae/rc.geomyidae.new
blob: 38c02f8be1bfadfa7937ac03c6cd745833bd1c6f (plain)
#!/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