#!/bin/sh
#
#pragma ident "@(#)skipd_restart.sh	1.5  98/09/25"
#
#  Kill and restart the SKIP key management/certificate daemon

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

SUNOS=`uname -r | sed 's/\..*//g'`
if [ $SUNOS = 5 ]; then
	SKIP_BIN=/usr/sbin
	SKIP_ETC=/etc/skip/
else
	SKIP_BIN=/usr/skip/bin
	SKIP_ETC=/etc/skip
fi

SKIP_PID=$SKIP_ETC/skipd.pid
SKIPD=$SKIP_BIN/skipd

PATH=$SKIP_BIN:$PATH

if [ ! -f $SKIP_PID -o ! -x $SKIPD ]
then
	exit 1
fi

kill `cat $SKIP_PID` > /dev/null 2>&1

exec $SKIPD $*
