#!/bin/sh
#	Start snmpstatd daemon
# R means _call if snmpstatd failed only_.
#
pid=""
if [ -f /p/stat/STAT/LOCK ]; then
  pid=`cat /p/stat/STAT/LOCK | awk '{print $1}'`
fi
if [ x"$1" = x"R" -a x"$pid" != x ]
then
	kill -0 $pid && exit 0
fi
if [ x"$pid" != x ]
then
	echo kill $pid
	kill $pid
	rm -f /p/stat/STAT/LOCK
	sleep 5
fi
/p/stat/bin/snmpstatd -c /p/stat/Poll.conf &
echo "Starting snmpstatd"
