#!/bin/sh

# Source function library
. /etc/init.d/functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Modem Manager"

DAEMON=/usr/sbin/ModemManager
PIDFILE=/var/run/ModemManager.pid

set -e

case $1 in
        start)
                echo "Starting $DESC: "
		start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON}
        ;;
        stop)
                echo "Stopping $DESC: "
		start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}
		if [ -e ${PIDFILE} ];then
			rm ${PIDFILE}
		fi;
        ;;
        restart|force-reload)
                $0 stop
                sleep 1
                $0 start
        ;;
        status)
                status ${DAEMON} || exit $?
        ;;
        *)
                N=/etc/init.d/pulseaudio
                echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
                exit 1
        ;;
esac

exit 0
