#!/bin/sh
# vnstatd-cycle - Sets up, flushes, and/or restarts "vnstatd"
# License:  BSD-style (for this file only)
# Revision: 100322

PREFIX=__META_PREFIX__
SBINDIR=$PREFIX/sbin
export PATH=$SBINDIR:$PATH

vnstatd-stop

n=`ps ax | grep "vnstatd -d" | grep -v grep | wc -l`
if [ "x$n" \!= "x0" ]; then
    pause250ms

    n=`ps ax | grep "vnstatd -d" | grep -v grep | wc -l`
    if [ "x$n" \!= "x0" ]; then
        pause250ms

        n=`ps ax | grep "vnstatd -d" | grep -v grep | wc -l`
        if [ "x$n" \!= "x0" ]; then
            killany --wait "vnstatd -d"
        fi
    fi
fi

vnstatd-start
