#!/bin/sh
#
. /opt/HAC/bin/rsf.sh

service=${RSF_SERVICE:-"service_name"}
script="`basename $0`"

case "${1}" in

'start')
	#
	# Notify any watchers that we are starting the service.
	notify_watchers "${LOG_INFO}" "RSF_SERVICE_STARTUP" "service=${service}s resource=NONE status=OK"

	#
	# Log our interface state before we start the service.
	dated_echo '========= ip addr/ifconfig before interface/vip plumbing ========='
	echo
	if [ -f "/usr/sbin/ip" ]; then
		ip addr
	else
		ifconfig -a
	fi
	echo
	dated_echo '=========  ip route/netstat after interface/vip plumbing  ========='
	echo
	if [ -f "/usr/sbin/ip" ]; then
		ip route
	else
		netstat -rn
	fi
	echo
	dated_echo '=========       ip/ifconfig/netstat complete        ========='

	rc_exit ${service} ${RSF_OK}
	;;

'stop')
	notify_watchers "${LOG_INFO}" "RSF_SERVICE_SHUTDOWN" "service=${service} resource=NONE status=OK"
	rc_exit ${service} ${RSF_OK}
	;;

'check')
	exit ${RSF_CHECK_NORESRC}
	;;

*)
	rc_exit ${service} ${RSF_WARN} "usage: $0 <start|stop|check>"
	;;

esac
