#!/bin/ksh -p

# Copyright (c) 2004 by Sun Microsystems, Inc.
# All rights reserved


PGREP=/usr/bin/pgrep
PKILL=/usr/bin/pkill
RWHOD=in.rwhod

RVAL=$($PGREP -lf -P 1 $RWHOD)
if [[ -z "$RVAL" ]]; then
    return 0;
else
    $($PKILL -x -u 0 -P 1 $RWHOD)    # kill the running in.rwhod daemon
    set -- $RVAL
    shift
    eval "${*}"         # restart the in.rwhod daemon with same arguments
fi

