#! /bin/sh
# This script can be used to start smsd as a daemon under Linux and Solaris.

return="success"
case "$1" in
    start)
        echo "Starting SMS Daemon:"
	find /var/spool/sms -name '*.LOCK' -exec rm {} \;
        /usr/local/bin/smsd || return="failed" &
	echo "$return"
        ;;
    stop)
        echo "Shutting down SMS services:"
        pkill -x smsd || return="failed"
	echo "$return"
        ;;
    restart|reload)
	$0 stop  &&  $0 start  ||  return="failed"
	echo "$return"
	;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

