#! /bin/sh
# 
# osso-iap	Nokia OSSO Internet Access Point manager startup
#
#		Written by Nokia based on skeleton code
#		written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian 
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
IC_DAEMON=/usr/sbin/icd
NAME=osso-ic
DESC="OSSO Internet Connectivity daemon"

test -x $DAEMON || exit 0

set -e

case "$1" in
  start)
	# Start daemons
	echo -n "Starting $DESC: "
	if [ -x /usr/sbin/dsmetool ]; then
	    dsmetool -n -1 -r "$IC_DAEMON"
	else
	    start-stop-daemon --start --quiet --user $USER \
		--exec $IC_DAEMON -- -d
	fi
	echo "icd."
	;;
  stop)
	echo -n "Stopping $DESC: "
	if [ -x /usr/sbin/dsmetool ]; then
	    dsmetool -k "$IC_DAEMON"
	else
	    start-stop-daemon --stop --quiet --oknodo --user $USER \
		--exec $IC_DAEMON
	fi
	echo "icd."
	;;
  reload|restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	"$0" stop
	"$0" start
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
