#! /bin/sh
# This script can be used to start smsd as a daemon under Linux.
# copy it to /sbin/init.d or /etc/init.d (depending on your Linux version)

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

