#! /bin/sh
# This script can be used to start smsd as a daemon 
# in /sbin/init.d for Suse Linux.
# Modified for Mandrake package 20010729 by Buchan Milne <bgmilne@cae.co.za>

# chkconfig: - 91 35
# description: Starts and stop the gnokii-smstools email2sms gateway

# Source function library.
if [ -f /etc/init.d/functions ] ; then
	. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
	. /etc/rc.d/init.d/functions
else
	exit 0
fi  

return="success"

start(){
        echo -n "Starting SMS Services:"
        daemon /usr/bin/smsd 
	RETVAL=$?
	echo
	return $RETVAL
}
stop(){
        echo -n "Shutting down SMS services:"
        killproc /usr/bin/smsd
	RETVAL=$?
	echo
	return $RETVAL
}
reload(){
	stop 
	start
}

case "$1" in
    start)
      start
      ;;
    stop)
     stop
     ;;
    reload|restart)
     reload
     ;;
    *)
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
esac
