#!/bin/sh
#
# Start networking daemons. (with xinetd)

test -f /usr/sbin/rpc.portmap || exit 0
test -f /usr/sbin/xinetd || exit 0

case "$1" in
  start)
	echo -n "Starting base networking daemons: "
	echo -n "rpc.portmap " ; start-stop-daemon --start --quiet --exec /usr/sbin/rpc.portmap
	echo -n "xinetd" ; start-stop-daemon --start --quiet --exec /usr/sbin/xinetd
	echo
	;;
  stop)
	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/xinetd
	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/rpc.portmap
	killall -9 slattach 2>/dev/null || exit 0
	;;
  reload)
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --signal 1 --exec /usr/sbin/xinetd
	;;
  *)
	echo "Usage: /etc/init.d/netbase {start|stop}"
	exit 1
	;;
esac

exit 0
