#! /bin/sh
#
# functions	This file contains functions to be used by most or all
#		shell scripts in the /etc/init.d directory.
#
# Version:	@(#) /etc/init.d/functions 1.01 26-Oct-1993
#
# Author:	Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#

  # First set up a default search path.
  export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/etc"

  # A function to start a program.
  daemon() {
	# Test syntax.
	if [ $# = 0 ]
	then
		echo "Usage: daemon {program}"
		return 1
	fi
	# See if it already runs.
	[ "`pidof $1`" != "" ] && return

	# echo basename of the program.
	echo -n "${1##*/} "

	# And start it up.
	$*
  }

  # A function to stop a program.
  killproc() {
	# Test syntax.
	if [ $# = 0 ]
	then
		echo "Usage: killprog {program}"
		return 1
	fi

	pid=`pidof $1`
	echo -n "Killing $pid "
	[ "$pid" != "" ] && kill -9 $pid
  }

