#!/bin/sh
# $Id: ping.control,v 1.1 2001/04/10 03:32:14 solar Exp $

. /etc/control.d/functions

BINARY_PING=/sbin/ping
BINARY_PING6=/sbin/ping6

new_fmode public 4555 root wheel
new_fmode wheelonly 4550 root wheel
new_fmode restricted 700 root wheel

case "$*" in
list)
	echo "$NAME_LIST"
	;;
status|'')
	STATUS_PING="`control_fmode "$BINARY_PING" status`" || exit 1
	STATUS_PING6="`control_fmode "$BINARY_PING6" status`" || exit 1
	if [ -n "$STATUS_PING" -a "$STATUS_PING" = "$STATUS_PING6" ]; then
		echo "$STATUS_PING"
	else
		echo "unknown"
	fi
	;;
*)
	control_fmode "$BINARY_PING" "$*" || exit 1
	control_fmode "$BINARY_PING6" "$*" || exit 1
	;;
esac
